note 47549 added to function.wddx-deserialize

From: Date: Fri, 19 Nov 2004 20:11:27 +0000
Subject: note 47549 added to function.wddx-deserialize
Groups: php.notes 
Request: Send a blank email to php-notes+get-80780@lists.php.net to get a copy of this message
To properly deserialize a wddx file it was to be utf8_encoded. The following code will NOT work (PHP5.0.2 FreeBSD): <?php $data = wddx_serialize_value(array("xyzåäö","abcd")); print $data; print_r(wddx_deserialize($data)); ?> Even thought the serialization is done right, the deserialization will not work unless you encode the text using utf8. This code WILL work: <?php $data = wddx_serialize_value(array(utf8_encode("xyzåäö"),"abcd")); print $data; print_r(wddx_deserialize($data)); ?> ---- Manual Page -- http://www.php.net/manual/en/function.wddx-deserialize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47549 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47549&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47549&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80780) next »