Created
September 22, 2016 13:16
-
-
Save MartijnBraam/48399e98bd05749ba612d7477a26735b to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
with open('test.dat', 'r', encoding="utf-8") as input_file: | |
with open('output.dat', 'wb') as output_file: | |
data = input_file.read() | |
data2 = data.encode('ascii', 'xmlcharrefreplace') | |
output_file.write(data2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment