[Python-Dev] Internationalization Toolkit

Mark Hammond mhammond@skippinet.com.au
Thu, 11 Nov 1999 08:36:04 +1100


Marc writes:

> > modes are evil.  python is not perl.  etc.
>
> But a requirement by the customer... they want to be able to
> set the locale
> on a per thread basis. Not exactly my preference (I think all locale
> settings should be passed as parameters, not via globals).

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.

For example, if we went with UTF-8 as the only default encoding, then
HP may be forced to use a helper function to perform the conversion,
rather than the built-in functions.  This helper function can use TLS
(in Python) to store the encoding.  At least it is localized.

I agree that having a default encoding that can be changed is a bad
idea.  It may make 3 line scripts that need to print something easier
to work with, but at the cost of reliability in large systems.  Kinda
like the existing "locale" support, which is thread specific, and is
well known to cause these sorts of problems.  The end result is that
in your app, you find _someone_ has changed the default encoding, and
some code no longer works.  So the solution is to change the default
encoding back, so _your_ code works again.  You just know that whoever
it was that changed the default encoding in the first place is now
going to break - but what else can you do?

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.

Mark.

>
> > > Are we digging a hole for ourselves? Maybe. But there are
> two other big
> > > platforms that have the same hole to dig out of *IF* it
> ever comes to
> > > that. I posit that it won't be necessary; that the people
> needing UCS-4
> > > can do so entirely in Python.
> >
> > last time I checked, there were no characters (even in the
> > ISO standard) outside the 16-bit range.  has that changed?
>
> No, but people are already thinking about it and there is
> a defined range in the >16-bit area for private encodings
> (F0000..FFFFD and 100000..10FFFD).
>
> --
> Marc-Andre Lemburg
>
______________________________________________________________________
> Y2000:                                                    51 days
left
> Business:
http://www.lemburg.com/
> Python Pages:
http://www.lemburg.com/python/
>
>
> _______________________________________________
> Python-Dev maillist  -  Python-Dev@python.org
> http://www.python.org/mailman/listinfo/python-dev
>