Re: SOAP character encoding bug

From: Date: Sat, 11 May 2002 17:25:27 +0000
Subject: Re: SOAP character encoding bug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6048@lists.php.net to get a copy of this message
I thought a lot about encoding in the soap library when I started testing UTF-8 a while back. Here's the issue. If someone passes in a string that has already been passed through utf8_encode, and the soap library assumes it should utf8_encode any strings it gets, data is messed up. without a is_utf8() function in php, I decided it is best to make the developer pay attention to the encoding issue, even though I would prefer to have it done transparently. There are already a few soap libraries out there that incorrectly make assumptions about utf8 encoding, which messes up interoperability, I want to avoid that. Shane Pierre-Alain Joye wrote:
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().
You are right :), as "we" see in interop test files. I misunderstood the soap_value class. Maybe it s in the todo list to take care automaticly about the encoding method, but actually the decode method does not take care about it. It s up to the user to know the encoding method of the service. pa


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