views:

112

answers:

1
+2  A: 

Have you run decode on the unpickled string using the correct encoding ("cp1251" by the look of it)? If not, you need to do this to make sure you're passing a Unicode string to the GUI.

Vinay Sajip
when i'm trying to decode string with cp1251, ascii or any other encoding, i'm getting error "UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)"
Kirill Titov
Don't use ASCII, as your string plainly contains non-ASCII characters. Use for example "\xe3\xee\xe4".decode("cp1251") which should result in "год" being displayed.You can't use random encodings - it has to be the correct one which converts the bytes "\xe3\xee\xe4" to Unicode "год".
Vinay Sajip