php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13873 wddx_*() functions only handle ascii
Submitted: 2001-10-30 11:01 UTC Modified: 2002-01-02 20:58 UTC
From: johan at ekenberg dot se Assigned:
Status: Closed Package: WDDX related
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
 [2001-10-30 11:01 UTC] johan at ekenberg dot se
It seems that the wddx_*() functions only handle US-ASCII, although I see a referense to ISO-8859-1 and UTF-8 in the source:

   print wddx_deserialize(wddx_serialize_value("xyz???"));

produces:

   xyz???


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-30 18:15 UTC] sniper@php.net
Works fine for me with latest CVS. Try a snapshot from
http://snaps.php.net/

--Jani

 [2001-10-31 05:41 UTC] johan at ekenberg dot se
No, it still doesn't work here. I got the latest (oct 31) snap from snaps.php.net:

  # ./configure --with-xml --enable-wddx
  # make
  # ./php wddx_test.php
  X-Powered-By: PHP/4.2.0-dev
  Content-type: text/html

  xyz???

wddx_test.php contains the one-liner submitted in my original report:
  print wddx_deserialize(wddx_serialize_value("xyz???"));

/Johan

 [2001-10-31 19:28 UTC] sniper@php.net
What are your:

- linux distribution
- configure line for PHP

--Jani

 [2001-11-01 04:26 UTC] johan at ekenberg dot se
1. Linux distribution is Slackware 4.0 which is a libc 5 dist. Running kernel 2.2.19

2. configure --with-xml --enable-wddx
 [2001-11-10 04:25 UTC] sniper@php.net
Propably your locales again. Anyway, what does this output:

<?php echo wddx_serialize_value("xyz???"); ?>


 [2001-11-12 10:19 UTC] johan at ekenberg dot se
Nowhere in the docs is it mentioned that wddx-functions are affected by locale settings. But experimenting with setlocale() reveals that it is indeed a locale issue:

<?php
   print wddx_serialize_value("xyz???") . "\n";
   setlocale(LC_ALL, "sv_SE");
   print wddx_serialize_value("xyz???");
?>

produces:

<wddxPacket version='1.0'><header/><data><string>xyz<char code='FFFFFFE5'/><char code='FFFFFFE4'/><char code='FFFFFFF6'/></string></data></wddxPacket>
<wddxPacket version='1.0'><header/><data><string>xyz???</string></data></wddxPacket>

If this is correct, ie wddx*() _should_ be affected by locale, then I suggest that it be described in the docs as soon as possible!

Thanks for your work and patience,
/Johan
 [2002-01-02 20:58 UTC] mfischer@php.net
Documentation fixed.
 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of mfischer
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e9a7d7a25a7d06864739ad967281799f393fc19b
Log: - Fix #13873.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC