Skip to content

Commit

Permalink
Update utils.py (#145)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
XEL-Maker and vinitkumar authored Jul 1, 2022
1 parent e3a7bc2 commit 0aa7da2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json2xml/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0aa7da2

Please sign in to comment.