Skip to content

Commit 0aa7da2

Browse files
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 <[email protected]>
1 parent e3a7bc2 commit 0aa7da2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json2xml/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def readfromjson(filename: str) -> dict[str, str]:
2727
Reads a json string and emits json string
2828
"""
2929
try:
30-
json_data = open(filename)
30+
json_data = open(filename, encoding="utf-8")
3131
data = json.load(json_data)
3232
json_data.close()
3333
return data

0 commit comments

Comments
 (0)