ID: 37611
User updated by: jdolecek at NetBSD dot org
Reported By: jdolecek at NetBSD dot org
Status: Open
Bug Type: WDDX related
Operating System: Any
PHP Version: 5.1.5CVS
New Comment:
Seems the bug submit system turns non-ascii character to some entities,
the Č should be character with ordinal value 200 (i.e. result of
chr(200)).
Previous Comments:
------------------------------------------------------------------------
[2006-05-27 09:57:18] jdolecek at NetBSD dot org
Description:
------------
The condition which determines if a character in string should be
encoded using the <char code="XX"/> construct was changed in
php-src/ext/wddx/wddx.c was changed in rev. 1.135 to:
if (iscntrl((int)*(unsigned char *)p) || (int)*(unsigned char *)p >=
127) {
...encode using <char code="XX"/>...
}
This means that _all_ non-ascii characters are encoded with the
construct, which explodes the result packet size if non-ascii
characters are used.
The "|| (int)*(unsigned char *)p >= 127" parts seems as left-over debug
code and should be removed.
Reproduce code:
---------------
// this was not actually tried, this is just code review
wddx_serialize_value(char(200));
Expected result:
----------------
<wddxPacket
version='1.0'><header/><data><string>Č</string></data></wddxPacket>
Actual result:
--------------
<wddxPacket version='1.0'><header/><data><string><char
code="C8"/></string></data></wddxPacket>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37611&edit=1