[Python-3000] Does Py3k's print offer any unicode encoding help?

Ronald Oussoren ronaldoussoren at mac.com
Fri Feb 15 15:26:02 CET 2008


On 14 Feb, 2008, at 23:21, Martin v. Löwis wrote:

>> The code that guesses the default stdout encoding isn't very good,
>> especially not on OSX. Suggestions are welcome.
>
> Unfortunately, Apple isn't very cooperative here. There is no way
> of determining the encoding of a Terminal.app window, AFAIK
> (it's normally UTF-8, unless the user has changed it).

On OSX 10.5 Terminal sets the LANG environment variable, which  
pythonrun.c picks up to set the encoding of sys.stdout when that's  
connected to a tty.  Printing arbitary unicode strings therefore works  
fine on my system (at least using python 2.5, I haven't used 3.0 yet).

I haven't checked if other OS releases behave simularly.

Ronald

>
>
> Regards,
> Martin
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/ronaldoussoren%40mac.com



More information about the Python-3000 mailing list