From 0aa7da2b40f8550804dae6f4567178acb6d55114 Mon Sep 17 00:00:00 2001 From: Hyunho Kim <52307315+XEL-Maker@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:07:44 +0900 Subject: [PATCH] Update utils.py (#145) * Update utils.py add encoding type UTF-8 @readfromjson function, my language(korean) needs UTF-8 encoding options. * Update utils.py add a space after the comma (@line 30) * Update utils.py Write `encoding='utf-8'` in lowercase as in Python documentation. https://docs.python.org/3/howto/unicode.html Co-authored-by: Vinit Kumar --- json2xml/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json2xml/utils.py b/json2xml/utils.py index 61ac077..b788f35 100644 --- a/json2xml/utils.py +++ b/json2xml/utils.py @@ -27,7 +27,7 @@ def readfromjson(filename: str) -> dict[str, str]: Reads a json string and emits json string """ try: - json_data = open(filename) + json_data = open(filename, encoding="utf-8") data = json.load(json_data) json_data.close() return data