Printing characters outside of the ASCII range

danielk danielkleinad at
Fri Nov 9 18:17:53 CET 2012

I'm converting an application to Python 3. The app works fine on Python 2.

Simply put, this simple one-liner:


errors out with:

Traceback (most recent call last):
  File "D:\home\python\", line 1, in <module>
  File "C:\Python33\lib\encodings\", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\xfe' in position 0: character maps to <undefined>

I'm using this character as a delimiter in my application.

What do I have to do to convert this string so that it does not error out?

More information about the Python-list mailing list