Forget to tell, sorry. I'm using Python 3.4.1 On Thu, Sep 11, 2014 at 3:53 PM, Sebastian Silva <sebast...@fuentelibre.org> wrote:
> Hi, > Python 2 suffers from these kinds of issues frequently. > > However Python 3 does not. > > Now, to deal with different encodings in Python 2 you need to cast to > unicode type, and then decode the string into unicode. > > something like this: > > name = unicode(original_name) > name = name.decode("utf-8") > > This is assuming your data source is in fact utf-8 encoded (which is the > most likely, imhe). > > Hope it helps, > Sebastian > > El jue, 11 de sep 2014 a las 1:43 PM, Juan Christian < > juan0christ...@gmail.com> escribió: > > I'm iterating through Steam users and friend lists. >> >> So, my program was working good, but then I got some UnicodeEncodeError >> randomly, I didn't know where was the problem, then I was checking the >> names that I got from the API by hand, and then I saw users with ™, ︻デ═一, >> ︻芫━━━━, º³® and tons of others different chars in their names... >> >> How can I make a "bulletproof" program against these chars? Can Python >> read them using some sort of function? >> > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor