[Zope] xmlrpc and charsets

Toby Dickenson tdickenson at geminidataloggers.com
Wed Oct 15 02:52:45 EDT 2003


On Tuesday 14 October 2003 20:41, Gilles Lenfant wrote:
> I'm stuck hacking the xmlrpc stuff. I can't understand the charset rules
> with xmlrpc in the Zope implementation.

The original xmlrpc spec required that all strings were ascii. very silly. 
Most xmlrpc implementations dont enforce that.... what library are you using 
on the client?

> Why doesn't it provide unicode string because, the server side is not
> supposed to know (and has no way to know AFAIK) the charset of the client
> side.

Are you sure it doesnt? if there is a unicode value inside the xml <string> 
tag I am sure the Unmarshaller class will convert it into a python unicode 
object.

> Should that charset be provided explicitely in the xmlrpc request to the
> server ?

character encoding of what?

the xml file defines its own character encoding, but that is an irrelevant 
detail of the implementation of the xmlrpc library.

or did you mean the encoding used by the client application? Assuming you are 
using pythons xmlrpclib, you need to pass unicode object parameters into the 
xmlrpc library and everything will 'just work'.


-- 
Toby Dickenson




More information about the Zope mailing list