Skip to content Skip to sidebar Skip to footer

Unicodeencodeerror: 'charmap' Codec Can't Encode Character

Python throws this when using the wolfram alpha api: Traceback (most recent call last): File 'c:\Python27\lib\threading.py', line 530, in __bootstrap_inner self.run() File

Solution 1:

Looks like you're passing in high-byte data to the API, and it's not liking that (\xd7 is the "Times" character; looks like an X). I'm not certain what purpose the print is for, but changing it to be print "l: " + repr(l) or print "l: ", l might at least get you past the above error, assuming you don't want to be in the business of converting the body to unicode (I'm assuming it's not...).

If that doesn't help, we'll need more details. Where is your input coming from? Is body unicode, or a byte string? Are you using python 2.7 or 3.x?

Post a Comment for "Unicodeencodeerror: 'charmap' Codec Can't Encode Character"