Re: SOAP character encoding bug

From: Date: Sat, 11 May 2002 16:32:00 +0000
Subject: Re: SOAP character encoding bug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6045@lists.php.net to get a copy of this message
If the xml document's encoding is UTF-8, the degree sign (in latin1 0xb0) must be represented as 0xc2 0xb0. If your xml is that in the userinfo below, it is indeed invalid. Try using utf8_encode(). - Stig On Sat, 2002-05-11 at 15:24, Martin Jansen wrote: > When returning ° from a SOAP server (PEAR::SOAP latest CVS), I > get the following soap_fault: > > soap_fault Object > ( > [error_message_prefix] => > [mode] => 1 > [level] => 1024 > [code] => Parser > [message] => XML error on line 10: not well-formed (invalid token) > [userinfo] => <?xml version="1.0" encoding="UTF-8"?> > <SOAP-ENV:Envelope > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > 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/" > xmlns:si="http://soapinterop.org/xsd" > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body> > <getItemsResponse><return > xsi:type="xsd:string">°</return></getItemsResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> > > [callback] => > ) > > Shouldn't PEAR::SOAP be able to parse the degree char properly? > > Attached is the client/server code I've used to reproduce this > bug. > > - Martin > > -- > Martin Jansen, <mail@martin-jansen.de> > http://www.martin-jansen.de/ > > ---- > > <?php > require_once 'SOAP/Server.php'; > > $server = new SOAP_Server; > > function showBug() { > return "°"; > } > > $server->addToMap("showBug", > null, > array("text") > ); > > $server->service($HTTP_RAW_POST_DATA); > ?> > ---- > > <?php > require_once "SOAP/Client.php"; > $client = new SOAP_Client(" >http://urmel/weblog/test.php"); > > echo "<pre>\n"; > var_dump($client->call("showBug")); > echo "</pre>\n"; > ?> > ---- > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.dev (#6045) next »