Re: Character encoding the copyright symbol

2009-08-13 Thread Ben Finney
Dave Angel da...@ieee.org writes: But I wanted to comment on the (c) remark. If you're in the US, that's the wrong abbreviation for copyright. The only recognized abbreviation is (copr). More reading on this: URL:http://en.wikipedia.org/wiki/Universal_Copyright_Convention

Character encoding the copyright symbol

2009-08-06 Thread Robert Dailey
Hello, I'm loading a file via open() in Python 3.1 and I'm getting the following error when I try to print the contents of the file that I obtained through a call to read(): UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in position 1650: character maps to undefined The file

Re: Character encoding the copyright symbol

2009-08-06 Thread Philip Semanchuk
On Aug 6, 2009, at 12:14 PM, Robert Dailey wrote: Hello, I'm loading a file via open() in Python 3.1 and I'm getting the following error when I try to print the contents of the file that I obtained through a call to read(): UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in

Re: Character encoding the copyright symbol

2009-08-06 Thread Richard Brodie
Robert Dailey rcdai...@gmail.com wrote in message news:29ab0981-b95d-4435-91bd-a7a520419...@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:

Re: Character encoding the copyright symbol

2009-08-06 Thread Robert Dailey
On Aug 6, 11:31 am, Richard Brodie r.bro...@rl.ac.uk wrote: Robert Dailey rcdai...@gmail.com wrote in message news:29ab0981-b95d-4435-91bd-a7a520419...@b15g2000yqd.googlegroups.com... UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in position 1650: character maps to

Re: Character encoding the copyright symbol

2009-08-06 Thread Albert Hopkins
On Thu, 2009-08-06 at 09:14 -0700, Robert Dailey wrote: Hello, I'm loading a file via open() in Python 3.1 and I'm getting the following error when I try to print the contents of the file that I obtained through a call to read(): UnicodeEncodeError: 'charmap' codec can't encode character

Re: Character encoding the copyright symbol

2009-08-06 Thread Philip Semanchuk
On Aug 6, 2009, at 12:41 PM, Robert Dailey wrote: On Aug 6, 11:31 am, Richard Brodie r.bro...@rl.ac.uk wrote: Robert Dailey rcdai...@gmail.com wrote in message news:29ab0981-b95d-4435-91bd-a7a520419...@b15g2000yqd.googlegroups.com ... UnicodeEncodeError: 'charmap' codec can't encode

Re: Character encoding the copyright symbol

2009-08-06 Thread Richard Brodie
Robert Dailey rcdai...@gmail.com wrote in message news:f64f9830-c416-41b1-a510-c1e486271...@g19g2000vbi.googlegroups.com... As you can see, I am trying to load the file with encoding 'cp1252' which, according to the python 3.1 docs, translates to windows-1252. I also tried 'latin_1', which

Re: Character encoding the copyright symbol

2009-08-06 Thread Martin v. Löwis
As a side note, you should probably use something other than file for the parameter name in GetFileContentsAsString() since file() is a Python function. Python 3.1.1a0 (py3k:74094, Jul 19 2009, 13:39:42) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. py

Re: Character encoding the copyright symbol

2009-08-06 Thread Philip Semanchuk
On Aug 6, 2009, at 3:14 PM, Martin v. Löwis wrote: As a side note, you should probably use something other than file for the parameter name in GetFileContentsAsString() since file() is a Python function. Python 3.1.1a0 (py3k:74094, Jul 19 2009, 13:39:42) [GCC 4.3.3] on linux2 Type help,

Re: Character encoding the copyright symbol

2009-08-06 Thread Benjamin Kaplan
On Thu, Aug 6, 2009 at 12:41 PM, Robert Daileyrcdai...@gmail.com wrote: On Aug 6, 11:31 am, Richard Brodie r.bro...@rl.ac.uk wrote: Robert Dailey rcdai...@gmail.com wrote in message news:29ab0981-b95d-4435-91bd-a7a520419...@b15g2000yqd.googlegroups.com... UnicodeEncodeError: 'charmap' codec

Re: Character encoding the copyright symbol

2009-08-06 Thread Dave Angel
Robert Dailey wrote: Hello, I'm loading a file via open() in Python 3.1 and I'm getting the following error when I try to print the contents of the file that I obtained through a call to read(): UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in position 1650: character maps