#46496 [Bgs]: [PATCH] wddx_serialize_value() treats input as ISO-8859-1

From: Date: Thu, 06 Nov 2008 05:00:50 +0000
Subject: #46496 [Bgs]: [PATCH] wddx_serialize_value() treats input as ISO-8859-1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-130683@lists.php.net to get a copy of this message
ID: 46496 User updated by: mark at hell dot ne dot jp -Summary: wddx_serialize_value() treats input as ISO-8859-1 Reported By: mark at hell dot ne dot jp Status: Bogus Bug Type: WDDX related Operating System: Linux PHP Version: 5.2.6 New Comment: Here's a patch against PHP 5.2.7rc2 to fix this issue. The real problem is about WDDX always considering input is ISO-8859-1. This is not consistent with PHP <5.2.5, not consistent with the XML api, and not consistent with the documentation. http://ookoo.org/svn/snip/php-5.2.7rc2_wddx_utf8_resolved.patch Previous Comments: ------------------------------------------------------------------------ [2008-11-06 04:54:54] mark at hell dot ne dot jp Tested and reproduced with PHP 5.2.7rc2 ------------------------------------------------------------------------ [2008-11-06 04:36:12] mark at hell dot ne dot jp Hello, I'd like this bug to be reopened. The &#xxx; are due to the PHP's bugtracker unability to display unicode characters. My report was initially written with korean string. Here's a screenshot of an UTF-8 terminal with the same test: http://beta.magicaltux.net/php5_bug_utf8_terminal.png ------------------------------------------------------------------------ [2008-11-06 01:14:25] jani@php.net http://fi.php.net/manual/en/wddx.examples.php "Note: If you want to serialize non-ASCII characters you have to convert your data to UTF-8 first" ------------------------------------------------------------------------ [2008-11-05 17:30:47] mark at hell dot ne dot jp Description: ------------ As written on the page on : http://fr.php.net/manual/en/ref.wddx.php wddx_serialize_value() always treats input as ISO-8859-1. This behaviour has changed in PHP 5.2.5, and has caused a few bugs on our side (and it seems we are not the only ones). For now the workaround is to use utf8_decode() on the resulting XML string. Reproduce code: --------------- <?php header("Content-Type: text/xml;encoding=utf-8"); echo wddx_serialize_value("&#50504;&#45397; &#54616;&#49464;&#50836;"); ?> Expected result: ---------------- <wddxPacket version='1.0'><header/><data><string>&#50504;&#45397; &#54616;&#49464;&#50836;</string></data></wddxPacket> Actual result: -------------- <wddxPacket version='1.0'><header/><data><string>ì&#149;&#136;ë&#133;&#149; í&#149;&#152;ì&#132;¸ì&#154;&#148;</string></data></wddxPacket> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46496&edit=1

« previous php.bugs (#130683) next »