[Tutor] UnicodeEncodeError

Rob Sutherland luckdancing at gmail.com
Fri Oct 3 19:50:27 CEST 2008


I'm working on a python application that stores email in a postgresql
database and
I'm encountering the UnicodeEncodeError - while storing a particular
email I receive
this error

UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019'
in position 144: character maps to <undefined>

I'm a little confused about a workaround for this, from what I've
googled the approach seems to be to use the codecs.register_error and
codecs.ignore_errors to skip processing of the offending character. I
haven't been able to find an understandable example though, so if
anyone has one that would be great.

Rob


More information about the Tutor mailing list