A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/031015.html below:

[Patches] Patch for xmlrpc encoding

[Python-Dev] Re: [Patches] Patch for xmlrpc encoding [Python-Dev] Re: [Patches] Patch for xmlrpc encodingBrian 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




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4