You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Ac...@smartvia.de on 2002/04/19 17:59:27 UTC
UTF-8 encoding with Apache-SOAP
Hi all,
I now try since several days to send german umlauts via SOAP, maybe
somebody can help me:
I sent from a SOAP client a proper encoded UTF-8 request, eg a German
Ä (A-Umlaut) in a method parameter is encoded in 2 bytes as 0xC3 and
0x84 (verified with a tcpTracer).
The request will be received by an Apache-Soap server running under
Apache-Tomcat together with Apache-Xerces everything in Java.
After parsing, the element value will be available as standard Java
string but is NOT encoded proper!
I expected eg the Ä as beeing in Java-string as \u00c4, but it is
still as two chars \u00c3 and \u0084. The two UTF-8 bytes have simply
been copied one-to-one into UTF-16 Java-string representation instead
of beeing encoded to the right UTF-16 value.
Here my example SOAP request with the french word "OEuvre":
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:encodingStyle="http://schemas.xmlsoap.org/soap/encoding//"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<soap:Body>
<method:logout xmlns:method="urn:logout">
<sessionName xsi:type="xsd:string">Å'uvre</sessionName>
</method:logout>
</soap:Body>
</soap:Envelope>
I don't want to send the character escaped like Œ this is a possibility, but not supported automatically by my SOAP client.
Do anyone have an idea how to get the string proper encoded in Java?
Thanks
Achim