Skip to content

Commit 3afdbf6

Browse files
authored
Merge pull request #44 from northword/patch-1
fix: specify encoding utf-8 when opening a file
2 parents bda7d6b + 60a3d93 commit 3afdbf6

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)