|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38067 Parameters are not decoded from utf-8 when using encoding option
Submitted: 2006-07-11 15:42 UTC Modified: 2006-07-12 09:00 UTC
From: afalak at poczta dot onet dot pl Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5CVS-2006-07-11 (CVS) OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: afalak at poczta dot onet dot pl
New email:
PHP Version: OS:


 [2006-07-11 15:42 UTC] afalak at poczta dot onet dot pl
When encoding is set for both SoapClient and SoapServer (i.e.
ISO-8859-1) parameters are encoded properly to UTF-8 but not decoded on the other side.

Note: this error may be related to bug #38005 (SoapFault faultstring doesn't follow encoding rules) because before correction of this bug parameters were endoced/decoded properly, and now SoapFault parameters work fine but not method parameters.

Reproduce code:
$client = new SoapClient('a.wsdl'
		,array('encoding'	=> 'ISO-8859-1'));
$str = 'test: ?';
$res = $client->Test(array('str'=>$str));

function Test($param) {
	file_put_contents('test.txt', $param->str);
	return 1;
$server = new SoapServer('a.wsdl'
		,array('encoding'	=> 'ISO-8859-1'));

<?xml version="1.0" encoding="UTF-8"?>
		<s:schema elementFormDefault="qualified"
			<s:complexType name="Test">
				<s:attribute use="required" name="str" type="s:string"/>
			<s:element type="s0:Test" name="Test"/>
			<s:element type="s:int" name="Ret"/>

	<message name="TestSoapIn">
		<part name="parameters" element="s0:Test"/>
	<message name="TestSoapOut">
		<part name="parameters" element="s0:Ret"/>
	<portType name="TestSoap">
		<operation name="Test">
			<input message="s0:TestSoapIn"/>
			<output message="s0:TestSoapOut"/>
	<binding name="TestSoap" type="s0:TestSoap">
		<soap:binding transport=""
		<operation name="Test">
			<soap:operation soapAction="http:/Test/Test" style="document"/>
				<soap:body use="literal"/>
				<soap:body use="literal"/>
	<service name="Test">
		<port name="TestSoapPort" binding="s0:TestSoap">
			<soap:address location="http://localhost/server.php"/>

Expected result:
File text.txt shall contain exactly the same value as calling

test: ?

Actual result:
Parameter isn't decoded from UTF-8:

test: &#258;?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-12 09:00 UTC]
Ficed in CVS HEAD and PHP_5_2.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Feb 23 12:01:25 2020 UTC