Skip to content

Commit 60a3d93

Browse files
authored
fix: specify encoding utf-8 when opening a file
1 parent bda7d6b commit 60a3d93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xmltojson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def walktojson(self, elem):
8989
continue
9090

9191
print("converting " + fullname + " to " + newname)
92-
doc = w.makedoc(open(fullname).read())
92+
doc = w.makedoc(open(fullname, encoding='utf-8').read())
9393
obj = w.walktojson(doc)
9494
open(newname, 'w').write(json.dumps(obj,indent=2))
9595
elif singleFile:

0 commit comments

Comments
 (0)