python: how to handle unicode chars in ascii strings?
So, in python, this assignment is legal, but it breaks conversion:
Code:
In [44]: sys.getdefaultencoding() Code:
In [47]: a = u'André' At the end of the day, All these paths are going into a database. I just want everything that comes out of that database to be ascii & I'm having a hard time with that when unicode chars make their way into strings that think they are ascii. Hope that made sense. So... how can you convert ascii strings with unicode chars into actual ascii strings. Pardon me if my terminology is incorrect - see my first example for what I mean by "unicode chars in ascii strings" |
Continue discussion here:
http://www.linuxquestions.org/questi...3/#post3422175 |
All times are GMT -5. The time now is 06:39 AM. |