php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28969 Wrong data encoding of special characters
Submitted: 2004-06-30 09:38 UTC Modified: 2004-08-11 08:25 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ba at esoft dot dk Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5.0.0RC3 OS: Linux 2.6.7-gentoo-r3
Private report: No CVE-ID:
 [2004-06-30 09:38 UTC] ba at esoft dot dk

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-10 18:37 UTC] dmitry@php.net
Fixed in CVS HEAD.

By default ext/soap espect all string data in utf-8 encoding.

Now it is possible to change internal encoding with "encoding" option. It is acceptable both by SoapClient and SoapServer.

$SOAP = new SoapServer("test.wsdl", 
  array('encoding'=>'ISO-8859-1');

 [2004-08-11 08:25 UTC] ba at esoft dot dk
I will check it out.. sounds great!
 [2004-08-13 08:52 UTC] bryanguo at 21cn dot com
Hi, I tested the "encoding" option, but it doesn't work yet. In my case, I need to send/receive chinese characters in the data. So firstly I hope the SOAP data can encode with "gb2312":
$SOAP = new SoapServer("test.wsdl",array('encoding'=>'gb2312'));

Unfortunately, the return data is like below and "encoding" option is still 'UTF-8':
HTTP/1.1 200 OK
Date: Fri, 13 Aug 2004 06:42:12 GMT
Server: Apache/2.0.48 (Unix) PHP/5.0.0
X-Powered-By: PHP/5.0.0
Set-Cookie: SCP_WS_SESSIONID=635131d75dc3b040f0d96e88518fe02c; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 639
Connection: close
Content-Type: text/xml; charset="utf-8"

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://xxx" xmlns:ns2="http://xxx" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
         <ns1:FindDriversResponse>
            <FindDriversReturn SOAP-ENC:arrayType="ns2:Driver[0]" xsi:type="ns1:ArrayOf_tns1_Driver"/>
         </ns1:FindDriversResponse>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

What's the problem?
 [2004-08-15 21:28 UTC] cdcampos at netcabo dot pt

 [2004-08-17 09:40 UTC] hailei at starsoftcomm dot com

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 05:03:19 2014 UTC