Skip to content

Commit

Permalink
fix :\n
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirJabbari authored Jun 15, 2023
1 parent 83c034b commit 3f642a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def ArgParser():
def convertDictToJson(dict,outputFile):
with open(outputFile, "w",encoding='utf-8') as file:
json_formatted_str = json.dumps(dict, ensure_ascii=False,indent=2)
json_formatted_str = json_formatted_str.replace('\\"', '"') # Unescape double quotes
json_formatted_str = json_formatted_str.replace('\\\\n', '\\n') # Unescape escaped newlines
file.write(json_formatted_str)
file.close()

Expand Down

0 comments on commit 3f642a5

Please sign in to comment.