Bug #16618 [Com]: Fench chars are scrambled after Unserialize
| From: | ionut.aivanesei@gmail.com | Date: | Wed, 16 Sep 2009 16:26:26 +0000 |
| Subject: | Bug #16618 [Com]: Fench chars are scrambled after Unserialize | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-1655@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=16618&edit=1
ID: 16618
Comment by: ionut.aivanesei@gmail.com
Reported By: ionut dot aivanesei at gmail dot com
Summary: Fench chars are scrambled after Unserialize
Status: Open
Type: Bug
Package: XML_Serializer
Operating System: Irrelevant
Package Version: 0.20.0
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2009-09-16 16:30:57] galiganu
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
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=16618&edit=1