[Tutor] ascii codec cannot encode character
Alex Hall
mehgcap at gmail.com
Thu Jan 27 23:46:32 CET 2011
Hello again:
I have never seen this message before. I am pulling xml from a site's
api and printing it, testing the wrapper I am writing for the api. I
have never seen this error until just now, in the twelfth result of my
search:
UnicodeEncodeError: 'ASCII' codec can't encode character u'\u2019' in
position 42: ordinal not in range(128)
I tried making the strings Unicode by saying something like
self.title=unicode(data.find("title").text)
but the same error appeared. I found the manual chapter on this, but I
am not sure I want to ignore since I do not know what this character
(or others) might mean in the string. I am not clear on what 'replace'
will do. Any suggestions?
--
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap
More information about the Tutor
mailing list