Python strings outside the 128 range
Gerhard Fiedler
gelists at gmail.com
Thu Jul 13 16:18:23 EDT 2006
On 2006-07-13 12:04:58, Richard Brodie wrote:
>> s = "é"
>> print s
>> Is there a standard way to do this?
>
> Use Unicode strings, with an explicit encoding. Say no to ISO-8859-1 centrism.
> See: http://www.amk.ca/python/howto/unicode particularly the
> "Unicode Literals in Python Source Code" section.
So ...
# coding: utf-8
s = u'é'
print s
(Of course stored with an editor that writes the file in utf-8 encoding.)
Is this the proper way?
Will print take care of encoding translation according to the encoding used
in the target console?
Thanks,
Gerhard
More information about the Python-list
mailing list