Skip to content

Instantly share code, notes, and snippets.

@cocodrips
Created July 30, 2015 02:49
Show Gist options
  • Save cocodrips/7c39a08331ab95aa97b0 to your computer and use it in GitHub Desktop.
Save cocodrips/7c39a08331ab95aa97b0 to your computer and use it in GitHub Desktop.
Shift-JIS -> utf-8 in python
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