XML_RPC and unicode problems

Greg Hamilton gregh at object-craft.com.au
Fri Sep 17 01:59:58 CEST 2004


Thomas wrote:

>I am currently passing email messages over XML_RPC as the payload for
>a certain function call. On some of these messages, XML_RPC blows up
>on the server side and says something to the effect of:
>
>exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in
>position 1599: unexpected code byte
>
>Using the native Python codec for doing conversions gives me a similar
>error ('utf8' codec can't decode byte 0x93 in position 1328:
>unexpected code byte). That gives me the feeling that these specific
>messages are just funky. (Looking at the location in the file that
>they are choking seems to be random characters)
>
>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.



More information about the Python-list mailing list