Character encoding & the copyright symbol

Richard Brodie R.Brodie at rl.ac.uk
Thu Aug 6 12:31:58 EDT 2009


"Robert Dailey" <rcdailey at gmail.com> wrote in message 
news:29ab0981-b95d-4435-91bd-a7a520419ada at b15g2000yqd.googlegroups.com...

> UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in
> position 1650: character maps to <undefined>
>
> The file is defined as ASCII.

That's the problem: ASCII is a seven bit code. What you have is
actually ISO-8859-1 (or possibly Windows-1252).

The different ISO-8859-n variants assign various characters to
to '\xa9'. Rather than being Western-European centric and assuming
ISO-8859-1 by default, Python throws an error when you stray
outside of strict ASCII. 





More information about the Python-list mailing list