Skip to content

Instantly share code, notes, and snippets.

@elpatron68
Created November 13, 2018 16:43
Show Gist options
  • Select an option

  • Save elpatron68/8ce84317e6bcea6dfc91be83b2fc9fda to your computer and use it in GitHub Desktop.

Select an option

Save elpatron68/8ce84317e6bcea6dfc91be83b2fc9fda to your computer and use it in GitHub Desktop.
# converts iso encoded text file to utf-8
import codecs
def convertfromiso(iso_filename, uft8_filename):
data = codecs.open(iso_filename, 'r', 'iso-8859-1').read()
codecs.open(uft8_filename, 'w', 'utf-8').write(data)
def main():
convertfromiso('isofile.txt', 'new-utf8-file.txt')
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment