How to use xmlrpc properly with Korean (non-ascii characters)

Skip Montanaro skip at pobox.com
Tue Oct 22 11:07:47 EDT 2002


    >> Recently I tried xmlrpc to support Korean. In newsgroup, there are
    >> many complaint to xmlrpc from non-english, because it formally
    >> supports just ASCII. Here is solution for Korean Language support. I
    >> guess it would be properly adopted to other languages.

You have to be very careful when using XMLRPC with non-ASCII data.  Many
other implementations (such as Ken MacLeod's Frontier package in Perl) will
complain about XMLRPC encodings which contain non-ASCII data (at least out
of the box).  In my application, I preprocess arguments and return values,
encoding any Unicode data to UTF-8, then converting that as base64.  At the
other end the reverse transformation is performed.  This simple approach
works in my application because I don't use base64 objects for anything
else.  If I used base64 for other data I'd have to decide on a more complex
encoding such as a dictionary containing information about what the encoded
object really represents.

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list