[Python-Dev] Internationalization Toolkit

Andy Robinson andy@robanal.demon.co.uk
Thu, 11 Nov 1999 04:49:10 -0800 (PST)


> You almost convinced me there, but I think this can
> still be done
> without changing the default encoding: simply reopen
> stdout with a
> different encoding.  This is how Java does it.  I/O
> streams with an
> encoding specified at open() are a very powerful
> feature.  You can
> hide this in your $PYTHONSTARTUP.

Good point, I'm happy with this.  Make sure we specify
it in the docs as the right way to do it.  In an IDE,
we'd have an Options screen somewhere for the output
encoding.

What the Java code I have seen does is to open a raw
file and construct wrappers (InputStreamReader,
OutputStreamWriter) around it to do an encoding
conversion.  This kind of obfuscates what is going on
- Python just needs the extra argument.  

- Andy








=====
Andy Robinson
Robinson Analytics Ltd.
------------------
My opinions are the official policy of Robinson Analytics Ltd.
They just vary from day to day.

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com