Re: Re: Problem with UTF-8

Ulrich Schaefer <[email protected]> Fri, 14 Sep 2007 14:01:42 +0200
Newsgroups gmane.text.xml.rpc.specification
Message-ID <[email protected]>
John Wilson schrieb:
> Most software I know of which consumes XML over HTTP will ignore the  
> charset. The problem is that it is almost always wrong (e.g. it is  
> omitted but the encoding of the document is not US-ASCII).
>
> I'm pretty sure that Apache XML-RPC ignores the Content-type encoding.
>
>   
I agree.

(the following is from my longish experiments with XML-RPC 
interoperability several months ago)

Due to an "underspecification" in the initial XML-RPC specification, 
there is no guarantee that different implementations really treat 8 bit 
encoded strings such as UTF-8, ISO-8859-X or EUC-JP correctly in both 
directions.
The only thing that is defined for the string data type is exchange of 7 
bit US-ASCII characters. Playing with headers may help, but not 
necessarily, depending on the implementations used (I'm talking about 
*existing* XML-RPC implementations; using the same Java XML-RPC 
implementation at both ends e.g. is no problem).
My solution (without patching the XML-RPC libraries) for properly 
connecting Python clients with a Java Server was to implement the 
transfer via the binary data type (base64-encoded) with encoding and 
decoding from/to Unicode at both ends. This is bad because of the 
transcoding overhead, but formed the only solution for bidirectional 
Unicode text exchange that worked correctly even for Japanese 
characters:-). I can send Java & Python code examples if requested.

-Uli

-- 
Dr.-Ing. Ulrich Schaefer http://dfki.de/~uschaefer phone:+496813025154
    DFKI Language Technology Lab, D-66123 Saarbruecken, Germany
-------------------------------------------------------------------
   Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
     Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
   Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender), Dr. Walter Olthoff. Vorsitzender des Aufsichtsrats:
Prof. Dr. h.c. Hans A. Aukes. Amtsgericht Kaiserslautern, HRB 2313



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/