ID: 28154 Comment by: bob dot siefkes at nec-computers dot com Reported By: jay at kuantic dot com Status: Bogus Bug Type: *XML functions Operating System: * PHP Version: 5.0.0RC2 New Comment:
It might not be seen as a bug. For me it really behaves differently then expected. For instance when using xsltproc it keeps the same character set (latin1 in my case). Especially as the data should be stored in a MySQL record and knowing that MySQL will not (yet) support UTF8. Because SimpleXML is not keeping latin1 I found out that utf8_decode (and also iconv) cannot convert the EURO sign properly. The EURO sign is character code 128 decimal for latin 1 (=iso-8859-1). I'm using php 5.0.1 on IIS5. Previous Comments: ------------------------------------------------------------------------ [2004-06-07 09:42:53] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php use the iconv or utf8_decode function to convert to your desired charset after getting the values from simplexml. ------------------------------------------------------------------------ [2004-06-03 19:41:32] jerome dot wagner at oreka dot com OS is not given in the bug. I reproduced the problem on windows XP - php5RC2 ------------------------------------------------------------------------ [2004-04-26 22:05:27] [EMAIL PROTECTED] See also #28169: SimpleXML not parsing scandinavian characters correctly. ------------------------------------------------------------------------ [2004-04-26 11:36:28] jay at kuantic dot com Description: ------------ Simple Xml seems to output only utf-8. No matter how specified in encoding='iso-8859-1' and not simple function to change encodage. Reproduce code: --------------- $xmlstr = <<<XML <?xml version='1.0' encoding='iso-8859-1'?> <root> <section> <title>Gestion des Objets</title> <title>Gestion des Géolocalisation</title> <title>Autres questions...</title> </section> </root> XML; $xml = simplexml_load_string($xmlstr); foreach ($xml->section->title as $title) { echo $title, '<br />'; } ?> Expected result: ---------------- Gestion des Objets Gestion des Géolocalisation Autres questions... Actual result: -------------- Gestion des Objets Gestion des Géolocalisation Autres questions... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28154&edit=1