[imp] Signature in UTF-8 [solved]

Daniel A. Ramaley daniel.ramaley at DRAKE.EDU
Thu Feb 7 16:17:01 UTC 2008


On Thursday 07 February 2008 10:10, Jan Schneider wrote:
>> If the dump is actually ISO-8859-1 i can probably
>> just use iconv to switch it to UTF-8.
>
>That still wouldn't solve the problem. Serialized PHP arrays track
>string lengths. But PHP versions lower than 6 don't really know about
>string characters, they all consider strings as binary. As a result
>the same string has different lengths in different charsets. If you
>only convert the string contents, the string length stored in the
>serialized arrays don't match anymore, and PHP is no longer able to
>unserialize them.

Ah, now i understand. Thank you. If the file turns out to not be plain 
ASCII, i'll have to learn more about the serialized arrays and do 
something more complicated to convert them. I've looked at the 
serialized arrays that Horde uses in enough detail that i don't expect 
such a project to take very long, though certainly more than just using 
iconv would have...

------------------------------------------------------------------------
Dan Ramaley                            Dial Center 118, Drake University
Network Programmer/Analyst             2407 Carpenter Ave
+1 515 271-4540                        Des Moines IA 50311 USA


More information about the imp mailing list