#37544 [NEW]: Breaks national encoding
| From: | php at juzna dot com | Date: | Sun, 21 May 2006 16:27:59 +0000 |
| Subject: | #37544 [NEW]: Breaks national encoding | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-97427@lists.php.net to get a copy of this message | ||
From: php at juzna dot com
Operating system: WinXP
PHP version: 5.1.4
PHP Bug Type: XML related
Bug description: Breaks national encoding
Description:
------------
XML parsing breaks some national encoding, however there shouldn't be any
problem width it.
Reproduce code:
---------------
$xml = file_get_contents('http://xml.vht.cz/demo.xml');
$xml_parser = xml_parser_create();
xml_set_character_data_handler($xml_parser, "characterData");
xml_parse($xml_parser,$xml,true);
xml_parser_free($xml_parser);
function characterData($parser, $data) {
$data = trim($data);
if($data) var_dump($data);
}
Expected result:
----------------
Expexted original data with original encoding (like this):
Sutomore - hotel Zlatna obala
Jiøí Buèek - CK VHT
Hotelový komplex Zlatna Obala je umístìn ve vzdálenosti cca 500 m od
Sutomore. Má vlastní plá v prostøedí piniového háje.<br>
Actual result:
--------------
Broken encoding (absolutely wrong characters)
string(29) "Sutomore - hotel Zlatna obala"
string(2) "Ji"
string(20) "ÅÃ BuÄek - CK VHT"
string(7) "Hotelov"
--
Edit bug report at http://bugs.php.net/?id=37544&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37544&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37544&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37544&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37544&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37544&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37544&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37544&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37544&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37544&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37544&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37544&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37544&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37544&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37544&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37544&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37544&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37544&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37544&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37544&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37544&r=mysqlcfg