ID: 45314 Comment by: mark at hell dot ne dot jp Reported By: mikx at mikx dot de Status: Open Bug Type: WDDX related Operating System: * PHP Version: 5.2.6 New Comment:
This bug is related to bug #46496. Bug #37571 indeed seems to be at the origin of the problem. Previous Comments: ------------------------------------------------------------------------ [2008-07-22 22:50:54] [EMAIL PROTECTED] I guess (!) the fix for bug #37571 caused this problem. ------------------------------------------------------------------------ [2008-06-19 12:48:52] mikx at mikx dot de Description: ------------ wddx_serialize_value does not deal as expected with unicode characters in PHP 5.2.x or PHP 5.3.x. The function worked differently in PHP 5.1.6. When serializing a string or a more complex objects any unicode characters get again utf8 encoded - instead of getting in as is. Reproduce code: --------------- <a href="?utf8=%E9%A1%B5">Demo</a> (some chinese character) <hr> <form method="get" action="?"> <input type="text" name="utf8"> <input type="submit"> </form> <hr> <?php if (isset($_GET["utf8"])) { echo $_GET["utf8"]."<br>"; echo utf8_encode($_GET["utf8"])."<br>"; echo wddx_serialize_value($_GET["utf8"])."<br>"; } ?> Expected result: ---------------- The demo code is a little script that outputs the given query parameter "utf8" in three way: 1. Directly as recieved 2. utf8_encoded 3. serialized via wddx_serialize_value In <= 5.1.6 the resulting WDDX contained the utf8 characters excatly as given. In >= 5.2.0 the string gets UTF8 encoded again, just as if you would have valled utf8_encode on it. Actual result: -------------- While the new behavior might make sense for data going forward (although i am not sure what the expected behavior by WDDX spec is) this breaks backward compatibility with old data. As we have millons of database rows in unicode WDDX data this is a huge issue (at least to us). Can you please clarify if this is a bug, the expected behavior going forward and how to deal with backward compatibility issues (maybe an additional parameter to control the behavior)? This might be related to bug #41722 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45314&edit=1