#29711 [Fbk->Opn]: libxml and non iso-8859-1

From: Date: Tue, 17 Aug 2004 06:15:06 +0000
Subject: #29711 [Fbk->Opn]: libxml and non iso-8859-1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64762@lists.php.net to get a copy of this message
ID: 29711 User updated by: momo@php.net Reported By: momo@php.net -Status: Feedback +Status: Open Bug Type: XML related Operating System: ALL PHP Version: 5.0.1 New Comment: the external link give me the opportunity play with the html charset and make sure that all the readers see exactly what i see. anyway here the details: for the above script, the expact library used on php4, apply to "WINDOWS-1255" encoding as "ISO-8859-1" and do nothing with the chars. but libxml on the another hand, detect the "windows-1255" as known encoding, translate it to hebrew "UTF-8" using iconv for inner use and finally php corrupt it on http://cvs.php.net/co.php/php-src/ext/xml/xml.c?r=1.151#492 trying simply to convert it to "ISO-8859-1". To my opinion this behavior is a bug, if we knowing the source encoding, why not convert the UTF-8 back to the source encoding by default, using the internal iconv that was used for the reverse conversion? Previous Comments: ------------------------------------------------------------------------ [2004-08-17 08:06:07] derick@php.net Please fill in the details on this bug system and noy exculsive link to an external site. ------------------------------------------------------------------------ [2004-08-16 20:32:49] momo@php.net Description: ------------ here fuul details: http://www.phpil.net/php5xml.php Reproduce code: --------------- <? error_reporting(E_ALL); $xml = '<?xml version="1.0" encoding="WINDOWS-1255"?><x>àáâã</x>'; $p = xml_parser_create(); xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0); xml_set_element_handler($p, 'start_elem', 'end_elem'); xml_set_character_data_handler($p, 'cdata'); xml_parse($p,$xml, true); xml_parser_free($p); function start_elem($parser, $tagname, $attributes){} function end_elem($parser, $tagname){} function cdata($parser,$data) { echo $data; } ?> Expected result: ---------------- àáâã Actual result: -------------- ???? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29711&edit=1

« previous php.bugs (#64762) next »