Created
March 25, 2012 17:12
-
-
Save pdvyas/2198372 to your computer and use it in GitHub Desktop.
A trip to Unicode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
a = open('t.txt').read() | |
# t.txt contains П001 | |
s = [a] | |
print [d.decode('utf-8') for d in s] | |
# the line below fails | |
#print [d.encode('utf-8') for d in s] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment