note 81810 added to ref.wddx
| From: | iGEL at osu1 dot php dot net | Date: | Fri, 14 Mar 2008 10:03:25 +0000 |
| Subject: | note 81810 added to ref.wddx | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137050@lists.php.net to get a copy of this message | ||
As of version 5.2.5, this is wrong:
> Note: If you want to serialize non-ASCII characters you
> have to convert your data to UTF-8 first (see utf8_encode()
> and iconv()).
Serializing a string with WDDX will always convert it from ISO-8859-1 to UTF-8, no matter what the
original encoding is. So if your data already are UTF-8, you get just gibberish.
You can restore the original encoding by using utf8_decode on the serialized wddx data, even though
your original data may use chars not included in ISO-8859-1:
<?php
header("Content-Type: text/xml;encoding=utf-8");
echo utf8_decode(wddx_serialize_value("lk ml8l"));
?>
(This is why I dislike PHP, sorry)
----
Server IP: 217.13.201.10
Probable Submitter: 213.61.103.4
----
Manual Page -- http://www.php.net/manual/en/ref.wddx.php
Edit -- https://master.php.net/note/edit/81810
Del: integrated -- https://master.php.net/note/delete/81810/integrated
Del: useless -- https://master.php.net/note/delete/81810/useless
Del: bad code -- https://master.php.net/note/delete/81810/bad+code
Del: spam -- https://master.php.net/note/delete/81810/spam
Del: non-english -- https://master.php.net/note/delete/81810/non-english
Del: in docs -- https://master.php.net/note/delete/81810/in+docs
Del: other reasons-- https://master.php.net/note/delete/81810
Reject -- https://master.php.net/note/reject/81810
Search -- https://master.php.net/manage/user-notes.php