[Zope] XML RPC and umlaute

Toby Dickenson tdickenson at geminidataloggers.com
Wed Oct 15 02:57:40 EDT 2003


On Tuesday 14 October 2003 22:03, Sven Hohage wrote:
> I would  like to send back from a xml-rpc python server german umlaute(ä,ö,
> ü, ..) inside a list to Zope but I always get a parser error(it's obviously
> not a Zope problem). I've read that I can send back unicode encoded strings
> but how do I do it? Thanks.

The smallest change would be....

    def my_method(self):
        return self.string_containing_umlaute

....into....

    def my_method(self):
        return unicode(self.string_containing_umlaute,'latin-1')


Converting to unicode before output will work, but IMO its not the best 
approach. My recommendation is to always *store* language string as unicode 
type.


-- 
Toby Dickenson




More information about the Zope mailing list