Created
July 30, 2015 02:49
-
-
Save cocodrips/7c39a08331ab95aa97b0 to your computer and use it in GitHub Desktop.
Shift-JIS -> utf-8 in python
This file contains hidden or 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
import sys | |
import codecs | |
if len(sys.argv) < 3: | |
exit(1) | |
with codecs.open(sys.argv[2], 'w', 'utf-8') as f: | |
for line in codecs.open(sys.argv[1], 'r', 'cp932'): | |
f.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment