Skip to content

Instantly share code, notes, and snippets.

@elpatron68
Last active March 18, 2019 08:24
Show Gist options
  • Select an option

  • Save elpatron68/56c89456f8ec1d0fc669648fa6216356 to your computer and use it in GitHub Desktop.

Select an option

Save elpatron68/56c89456f8ec1d0fc669648fa6216356 to your computer and use it in GitHub Desktop.
Convert ISO8859 to UFT8
# 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', 'uft8file.txt')
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment