the stupid encoding problem to stdout

Chris Angelico rosuav at gmail.com
Mon Jun 13 10:49:06 EDT 2011


2011/6/14 Sérgio Monteiro Basto <sergiomb at sapo.pt>:
> And see, I can send ascii and utf-8 to utf-8 output and never have problems,
> but if I send ascii and utf-8 to ascii files sometimes got encode errors.
>

If something fits inside 7-bit ASCII, it is by definition valid UTF-8.
This is not a coincidence.

Those hours you've spent grokking this are not wasted, if you now have
a comprehension of characters vs encodings. More people in the world
need to understand that difference! :)

Chris Angelico



More information about the Python-list mailing list