Skip to content

Commit 4c47679

Browse files
committed
WIP: add ensure_ascii flage to _write_json
1 parent 46f284b commit 4c47679

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mne_bids/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ def _check_types(variables):
226226
)
227227

228228

229-
def _write_json(fname, dictionary, overwrite=False):
229+
def _write_json(fname, dictionary, overwrite=False, ensure_ascii=False):
230230
"""Write JSON to a file."""
231231
if op.exists(fname) and not overwrite:
232232
raise FileExistsError(
233233
f'"{fname}" already exists. Please set overwrite to True.'
234234
)
235235

236-
json_output = json.dumps(dictionary, indent=4)
236+
json_output = json.dumps(dictionary, indent=4, ensure_ascii=ensure_ascii)
237237
with open(fname, "w", encoding="utf-8") as fid:
238238
fid.write(json_output)
239239
fid.write("\n")

0 commit comments

Comments
 (0)