What encoding does u'...' syntax use?

Stefan Behnel stefan_ml at behnel.de
Fri Feb 20 15:58:59 EST 2009


Stefan Behnel wrote:
>>>>> print u'\xb5'
>> µ
> 
> What you
> see in the last line is what the Python interpreter makes of your unicode
> string when passing it into stdout, which in your case seems to use a
> latin-1 encoding (check your environment settings for that).

The "seems to" is misleading. The example doesn't actually tell you
anything about the encoding used by your console, except that it can
display non-ASCII characters.

Stefan



More information about the Python-list mailing list