#37611 [Opn->Bgs]: WDDX serializer encodes all non-ascii characters with <char/>
ID: 37611
Updated by: iliaa@php.net
Reported By: jdolecek at NetBSD dot org
-Status: Open
+Status: Bogus
Bug Type: WDDX related
Operating System: Any
PHP Version: 5.1.5CVS
New Comment:
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
This is definitely not left over debug code, it is needed on
some system to ensure proper encoding of non-ascii characters.
Previous Comments:
------------------------------------------------------------------------
[2006-05-27 09:58:51] jdolecek at NetBSD dot org
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)).
------------------------------------------------------------------------
[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
Thread (8 messages)