[Python-Dev] Re: [Patches] Patch for xmlrpc encoding

Ragnar Kjørstad python@ragnark.vestdata.no
Tue, 10 Dec 2002 09:25:14 +0100


On Tue, Dec 10, 2002 at 07:10:37AM +0100, Martin v. Löwis wrote:
> Ragnar Kjørstad <python@ragnark.vestdata.no> writes:
> 
> > The library makes an assumption that is (IMHO) just not valid. There =
is
> > simply no reason to assume strings use the packet encoding. 
> 
> There isn't a reason to assume that strings use any other encoding,
> either. 

Isn't that what sys.{get,set}defaultencoding is for?

> Reliance on the default encoding should be avoided as much as
> possible. Users wanting to transmit non-ASCII strings with xmlrpclib
> should pass Unicode objects in the first place.
> 
> Use byte strings to represent bytes, use Unicode strings to represent
> characters.

So perhaps it would be better to change the postgresql-modules to return
unicode-objects instead of strings?



-- 
Ragnar Kjørstad
Zet.no