Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.21.0

Bug #16618 Fench chars are scrambled after Unserialize
Submitted: 2009-09-16 20:30 UTC
From: galiganu Assigned:
Status: Open Package: XML_Serializer (version 0.20.0)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2009-09-16 20:30 UTC] galiganu (Ionut Aivanesei)
Description: ------------ Hi I have exported data from a database in a xml file. Data contains also french text. After Unserialize, accent chars are scrambled. Test script: --------------- $unserializer = &new XML_UNserializer(array('complexType' => 'array', 'parseAttributes' => true, 'whitespace' => XML_UNSERIALIZER_WHITESPACE_KEEP, 'guessTypes' => false)); $result = $unserializer->unserialize($xml_file, true); if ($result === true) { echo $this->unserializer->getUnserializedData(); } $xml_file contains: ------------------------------- <?xml version="1.0" encoding="ISO-8859-1" ?> <items> <item>Téléphonie résidentielle</item> </items> Expected result: ---------------- Téléphonie résidentielle Actual result: -------------- Téléphonie résidentielle

Comments

 [2009-09-16 21:26 UTC] galiganu (Ionut Aivanesei)
I found the problem. I have to explicitly use 'encoding' => 'ISO-8859-1' and 'targetEncoding' => 'ISO-8859-1' when creating the $unserializer object. Even though this is the encoding which is found in the XML tag.