Re: unserialize() & unicode issues
| From: | Antony Dovgal | Date: | Tue, 13 Sep 2005 10:07:29 +0000 |
| Subject: | Re: unserialize() & unicode issues | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18816@lists.php.net to get a copy of this message | ||
On 13.09.2005 13:52, Derick Rethans wrote:
On Tue, 13 Sep 2005, Antony Dovgal wrote:Yes, in this case there is no way to avoid converting (while doing unserialize()), but I don't see any point in creating Unicode strings when serializing with unicode_semantics is Off. -- Wbr, Antony DovgalOn 13.09.2005 13:32, val khokhlov wrote:Hello Antony, Tuesday, September 13, 2005, 11:21:21 AM, you wrote: AD> Even if the class name is in Unicode, we can try to convert it to ASCII AD> and fail only in the case when we can't find its class entry in the AD> list.I think, it's not the only way. If we don't care about being compatible with previous PHP'sserialize(), a more portable way is to store class/property names in unicode (if unicode_semantics=off when serializing, convert hash keys to unicode). Since we do know script encoding, we can always downgrade unicoded names into local encoding.So you propose to store strings/hash keys/class names in Unicode even if unicode_semantics is Off ? It looks like adding unnecessary overhead to me.But needed, as even with the semantics off, you can get unicode strings. Which can end up as array keys.