Ron Garret wrote:
> In article <[EMAIL PROTECTED]>,
>  Robert Kern <[EMAIL PROTECTED]> wrote:
> 
>>Ron Garret wrote:
>>
>>>I forgot to mention:
>>>
>>>
>>>>>>sys.getdefaultencoding()
>>>
>>>'utf-8'
>>
>>A) You shouldn't be able to do that.
> 
> What can I say?  I can.

See B).

>>B) Don't do that.
> 
> OK.  What should I do instead?

See below.

>>C) It's not relevant to the encoding of stdout which determines how unicode
>>strings get converted to bytes when printing them:
>>
>>>>>import sys
>>>>>sys.stdout.encoding
>>
>>'UTF-8'
>>
>>>>>sys.getdefaultencoding()
>>
>>'ascii'
>>
>>>>>print u'\xbd'
>>
>>1⁄2
> 
> OK, so how am I supposed to change the encoding of sys.stdout?  It comes 
> up as US-ASCII on my system.  Simply setting it doesn't work:

You will have to use a terminal that accepts UTF-8.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to