Created
July 11, 2010 13:01
-
-
Save inky/471524 to your computer and use it in GitHub Desktop.
Convert a file from UTF-8 to CP437.
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
#!/usr/bin/env python | |
import codecs, sys | |
try: | |
infile, outfile = sys.argv[1], sys.argv[2] | |
except IndexError: | |
sys.stderr.write('usage: %s input_file output_file\n' % sys.argv[0]) | |
sys.exit(1) | |
nfo = codecs.open(infile, encoding='utf-8').read() | |
codecs.open(outfile, 'w', encoding='cp437').write(nfo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment