Open UnknownProgrammer opened 9 years ago
This could probably just be in a try-except block (i.e. not mention unicode
).
This seems to be related to #24.
@UnknownProgrammer – how 'bout this:
try:
return s.encode('utf8', 'ignore')
except:
return str(s)
@kenny-evitt I think that encode is actually incorrect here. it should decode, otherwise if you pass bytes it becomes u"b'string'" which I don't think is not what you want?
@hayd I have no idea what that code does; I just know that it currently calls encode
so I'm at least a little skeptical that it should be changed to a call that seemingly does the opposite of what it does now. I created a thread in the forum asking for help reviewing your changes.
@kenny-evitt That's nicer, I just wanted it to work with python 3 without removing someone's work. I posted my opinion on #30
Added try-except because python3 has no unicode class.