|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-22 22:50 UTC] jani@php.net
[2008-11-16 10:20 UTC] mark at hell dot ne dot jp
[2008-11-20 04:55 UTC] magicaltux@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
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