Created
February 13, 2019 08:43
-
-
Save simonseo/cc106a968859fd3fabf00f9f0bd9146a to your computer and use it in GitHub Desktop.
Converts UTF-8 characters that were encoded in ASCII compatible '\uXXXX' format to non-ASCII characters
This file contains 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
import json, codecs | |
input_filename = "message.json" | |
output_filename = "message_new.json" | |
with codecs.open(input_filename, 'r', encoding='utf-8') as infile: | |
with codecs.open(output_filename, 'w', encoding='utf-8') as outfile: | |
json.dump(json.load(infile), outfile, ensure_ascii=False) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment