def transcode(infile, outfile=None, incoding="<STR_LIT>", outcoding="<STR_LIT:utf-8>"):
if not outfile:<EOL><INDENT>outfile = os.path.basename(infile) + '<STR_LIT>'<EOL><DEDENT>with codecs.open(infile, "<STR_LIT:rb>", incoding) as fpin:<EOL><INDENT>with codecs.open(outfile, "<STR_LIT:wb>", outcoding) as fpout:<EOL><INDENT>fpout.write(fpin.read())<EOL><DEDENT><DEDENT>
Change encoding of text file