Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion msbt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python
import argparse
import codecs
import json
import os.path
import re
Expand Down Expand Up @@ -186,7 +187,9 @@ def to_json(self, filename):

output['structure']['LBL1']['lists'] = self.sections['LBL1']['data']

json.dump(output, open(filename, 'w'), indent=2, sort_keys=True, ensure_ascii=False)
json_str = json.dumps(output, indent=2, sort_keys=True, ensure_ascii=False)
with codecs.open(filename, 'w', encoding='utf-8') as file:
file.write(json_str)

def from_json(self, filename):
json_data = json.load(open(filename, 'r'))
Expand Down