[Python-Dev] Internationalization Toolkit

M.-A. Lemburg mal@lemburg.com
Thu, 11 Nov 1999 15:36:41 +0100


Tim Peters wrote:
> 
> [Mark Hammond]
> > Sure - that is what this customer wants, but we need to be clear about
> > the "best thing" for Python generally versus what this particular
> > client wants.
> > ...
> > Having a fixed, default encoding may make life slightly more difficult
> > when you want to work primarily in a different encoding, but at least
> > your system is predictable and reliable.
> 
> Well said, Mark!  Me too.  It's like HP is suffering from Windows envy
> <wink>.

See my other post on the subject...

Note that if we make UTF-8 the standard encoding, nearly all 
special Latin-1 characters will produce UTF-8 errors on input
and unreadable garbage on output. That will probably be unacceptable
in Europe. To remedy this, one would *always* have to use
u.encode('latin-1') to get readable output for Latin-1 strings
repesented in Unicode.

I'd rather see this happen the other way around: *always* explicitly
state the encoding you want in case you rely on it, e.g. write

file.write(u.encode('utf-8'))

instead of

file.write(u) # let's hope this goes out as UTF-8...

Using the <default encoding> as site dependent setting is useful
for convenience in those cases where the output format should be
readable rather than parseable.

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