[Python-Dev] String encoding

M.-A. Lemburg mal@lemburg.com
Tue, 23 May 2000 16:20:19 +0200


Fredrik Lundh wrote:
> 
> M.-A. Lemburg wrote:
> > The recent discussion about repr() et al. brought up the idea
> > of a locale based string encoding again.
> 
> before proceeding down this (not very slippery but slightly
> unfortunate, imho) slope, I think we should decide whether
> 
>     assert eval(repr(s)) == s
> 
> should be true for strings.
> 
> if this isn't important, nothing stops you from changing 'repr'
> to use isprint, without having to make sure that you can still
> parse the resulting string.
> 
> but if it is important, you cannot really change 'repr' without
> addressing the big issue.

This is a different discussion which I don't really want to
get into... I don't have any need for repr() being locale
dependent, since I only use it for debugging purposes and
never to rebuild objects (marshal and pickle are much better
at that).

BTW, repr(unicode) is not affected by the string encoding:
it always returns unicode-escape.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/