Created
October 3, 2012 14:22
-
-
Save kotobukid/3827178 to your computer and use it in GitHub Desktop.
いつも悩むエンコード・デコード関係のメモ
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 | |
f = open('utf-8.html') | |
text = f.read() | |
f.close() | |
print text.decode('utf-8').encode('sjis') | |
#a = unicode(text, 'utf-8') | |
#a = u'こんにちは' | |
#print a.encode('sjis') | |
#print unicode(text, 'utf-8').decode('cp932') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment