code: def transcode(infile, outfile=None, incoding="shift-jis", outcoding="utf-8"):
      
      if not outfile:
          outfile = os.path.basename(infile) + '.utf8'
      with codecs.open(infile, "rb", incoding) as fpin:
          with codecs.open(outfile, "wb", outcoding) as fpout:
              fpout.write(fpin.read())
docs: Change encoding of text file