php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40052 wddx_deserialize compiling incorrect multibyte strings from <char> nodes
Submitted: 2007-01-07 22:11 UTC Modified: 2007-01-11 10:02 UTC
From: tim at whiteinteractive dot com Assigned:
Status: Not a bug Package: *Unicode Issues
PHP Version: 4.4.5RC1 OS: Mac OS X & Redhat
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim at whiteinteractive dot com
New email:
PHP Version: OS:

 

 [2007-01-07 22:11 UTC] tim at whiteinteractive dot com
Description:
------------
Problem with *De*serialization of multibyte characters in WDDX.

Correct sequences of <char> nodes (describing UTF8 characters) are deserializing incorrectly. I am experiencing this with 4.4.5 (snapshot)on Mac OS X and also 4.3.11 on Redhat.

The newer version serializes into <char> nodes correctly whereas the older version seems to leave these characters raw, but in both versions the deserialization is incorrect.



Reproduce code:
---------------
http://whiteinteractive.com/utf8bug/test.phps





Expected result:
----------------
-- Create double byte character -- 
string(2) "?"
dec: 194 163 
bin: 11000010 10100011 
hex: C2 A3 

-- Serialize with wddx_serialize_value --
<wddxPacket version='1.0'><header/><data><string><char code='C2'/><char code='A3'/></string></data></wddxPacket>

-- Deserialize with wddx_deserialize -- 
string(2) "?"
dec: 194 163 
bin: 11000010 10100011 
hex: C2 A3 

Actual result:
--------------
-- Create double byte character -- 
string(2) "?"
dec: 194 163 
bin: 11000010 10100011 
hex: C2 A3 

-- Serialize with wddx_serialize_value --
<wddxPacket version='1.0'><header/><data><string><char code='C2'/><char code='A3'/></string></data></wddxPacket>

-- Deserialize with wddx_deserialize -- 
string(2) "&#65533;&#65533;"
dec: 128 163 
bin: 10000000 10100011 
hex: 80 A3 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-07 22:56 UTC] tim at whiteinteractive dot com
Interactive example:
http://whiteinteractive.com/utf8bug/test2.php

and source:
http://whiteinteractive.com/utf8bug/test2.phps
 [2007-01-11 10:02 UTC] tony2001@php.net
Duplicate of bug #40080.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC