#28154 [Opn->Bgs]: Simple Xml output only utf-8

From: Date: Mon, 07 Jun 2004 07:42:57 +0000
Subject: #28154 [Opn->Bgs]: Simple Xml output only utf-8
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60469@lists.php.net to get a copy of this message
 ID:               28154
 Updated by:       chregu@php.net
 Reported By:      jay at kuantic dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *XML functions
 Operating System: *
 PHP Version:      5.0.0RC2
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[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] helly@php.net

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


Thread (6 messages)

« previous php.bugs (#60469) next »