Python strings outside the 128 range

Richard Brodie R.Brodie at rl.ac.uk
Thu Jul 13 11:04:58 EDT 2006


"Gerhard Fiedler" <gelists at gmail.com> wrote in message 
news:mailman.8127.1152801715.27775.python-list at python.org...

> If I understand you correctly, you are saying that if I distribute a file
> with the following lines:
>
>  s = "é"
>  print s
>
> I basically need to distribute also the information how the file is encoded
> and every user needs to use the same (or a compatible) encoding for reading
> this file?
>
> 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. 





More information about the Python-list mailing list