[Python-Dev] Re: [Patches] Patch for xmlrpc encoding
Brian Quinlan
brian@sweetapp.com
Tue, 10 Dec 2002 00:48:26 -0800
> > There isn't a reason to assume that strings use any other encoding,
> > either.
>
> Isn't that what sys.{get,set}defaultencoding is for?
If that is all you want to support, then:
def dump_string(self, value, escape=escape):
if unicode:
self.dump_unicode(unicode(value), escape)
else:
self.write("<value><string>%s</string></value>\n"
% escape(value))
dispatch[StringType] = dump_string
If you have changed the default encoding (not recommended) then
everything should work fine.
> So perhaps it would be better to change the postgresql-modules to
return
> unicode-objects instead of strings?
Maybe.
Cheers,
Brian