Tuesday, September 14, 2010

Python: Working with unicode, cp1251 encodings

It's impossible to capitalize or change symbol's case(lowercase or uppercase)  if you're using e.g. cp1251 or non-unicode format.

To fix it:
>>> print unicode("ПРИВЕТ",'utf-8').lower()
привет

No comments:

Post a Comment