Re: What is the use of "unicode.semantics" in PHP 6?

From: Date: Tue, 21 Aug 2007 16:21:49 +0000
Subject: Re: What is the use of "unicode.semantics" in PHP 6?
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-31795@lists.php.net to get a copy of this message
Nicolas Bérard-Nault wrote: > I have one specific example of where this can be a HUGE headache. Let's > say you have some serialized configuration files, saved with > unicode.semantics = 1, containing a single configuration array. Now, for > some reason, the administrator decides to turn unicode.semantics = 0 and > your configuration file does not work anymore. That's because > $arr[(unicode) 'key'] and $arr[(binary) 'key'] are different. Hence, all > the keys in the configuration array have to be explicitly accessed with > either (binary) or (unicode). You are going to have this problem with or without the Unicode switch though. Whenever you write a string to a file or socket and you don't carry the actual encoding along with it, then you are completely at the whim of the default configuration to try to determine which encoding something is in. If one PHP instance has its default encoding set to Big-5 and another has it set to Shift-JIS you are going to have the exact same problem. -Rasmus

« previous php.internals (#31795) next »