php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33517 encoding decoding bug
Submitted: 2005-06-30 13:50 UTC Modified: 2005-06-30 13:54 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: christian at koch dot net Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.0.3 OS: Windows 2003 Server
Private report: No CVE-ID: None
 [2005-06-30 13:50 UTC] christian at koch dot net
Description:
------------
a simple xml file like:

<?xml version="1.0" encoding="iso-8859-15" standalone="yes"?>

<p>
	<name>?ml?ute sind d??f und ?chei?e</name>
</p>

saved as a windows ansi file, loaded with the script

$xml = simplexml_load_file("test.xml");

echo " bla ". $xml->name;

will convert the ansi xml elements into UTF-8 an in the PHP Script you must use utf8_decode(). Ich think thats a bug.

Reproduce code:
---------------
$xml = simplexml_load_file("test.xml");

echo " bla ". $xml->name;



Expected result:
----------------
if I use a ISO encoded XML file with a valid XML header, the SimpleXMLElement object should provide an iso string.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-30 13:54 UTC] derick@php.net
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

All XML extensions return UTF8, that is expected.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC