[Zope] XML-RPC and cyrillic text in CP1251 and UTF-8

Dmitry Litovchenko deadq@bkzebra.com
Sat, 24 Aug 2002 07:48:19 +0300


Currently I'm creating Control Panel for Zope site using Microsoft 
C#.NET which makes programs speaking in native 2-byte Unicode. Also I am 
using XMLRPC library for C#.NET which seem to function almost properly 
(almost or I haven't understood something).

The problems are:

1. Zope doesn't accept single parametered function calls, only zero or 
two or more, single parameter calls always fail.
2. Zope doesn't like UTF8-encoded XML request with parameter values 
containing cyrillic text, I always get failure response from server, but 
Zope likes UTF8-encoded response and passes its content correctly back 
to my program.
3. Empty (string "") return value wasn't correctly recognised by XMLRPC 
library (this is not Zope issue)

Workarounds found were:

1. Use second dummy parameter
2. Pack UTF8 cyrillic strings with BASE64 and unpack in receiving Zope 
method using base64 module and then decode to 1-byte CP1251 encoding 
using "encodings" module.
3. Use special response string value like "empty" or "none" which means 
"none" ;)

The question is:

Are there more straightforward methods to fix this or workarounds found 
are ok?