XML_RPC and unicode problems

phansen peter at engcorp.com
Thu Sep 16 21:07:37 EDT 2004


Greg Hamilton wrote:
> Thomas wrote:
>> What I've come to believe is that XML_RPC automatically assumes any
>> strings it transfers are unicode and thusly tries to do conversions on
>> these strings. Therefore, is there any way to keep XML_RPC from doing
>> unicode conversions, or is there some way for me to just pass raw data
>> over XML_RPC without having to worry about it?
>>  
> http://www.xmlrpc.com/spec
> 
> Have a look at the <base64> data type.

Disclaimer: I haven't used XML-RPC yet.

I looked at the above site, and noted this particular text in the
explanatory section below the very lightweight "spec":

"""Q. What characters are allowed in strings? Non-printable characters?
    Null characters? Can a "string" be used to hold an arbitrary chunk of
    binary data?

    A. Any characters are allowed in a string except < and &, which are
    encoded as < and &. A string can be used to encode binary
    data.
"""

Seems to me that description is inadequate, if one has to revert
to <base64> to pass through a string with an \xa0 in it.

I did a search and found this page from Fredrik Lundh, which seems
to be more clear on the whole thing, clearer even than the updated
spec which simply removed a previous reference to ASCII:
http://effbot.org/zone/xmlrpc-errata.htm

-Peter



More information about the Python-list mailing list