Last active
March 18, 2019 08:24
-
-
Save elpatron68/56c89456f8ec1d0fc669648fa6216356 to your computer and use it in GitHub Desktop.
Convert ISO8859 to UFT8
This file contains hidden or 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
| # 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