File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ def main():
37
37
help = 'a JSON file to be validated or pretty-printed' )
38
38
parser .add_argument ('outfile' , nargs = '?' , type = argparse .FileType ('w' ),
39
39
help = 'write the output of infile to outfile' )
40
+ parser .add_argument ('--no_escape' , action = 'store_true' , default = False ,
41
+ help = 'Do not set ensure_ascii to escape non-ASCII characters' )
40
42
parser .add_argument ('--indent' , default = '4' , type = parse_indent ,
41
43
help = 'Indent level or str for pretty-printing. '
42
44
'Use None for the most compact representation. '
@@ -62,6 +64,7 @@ def main():
62
64
with outfile :
63
65
json .dump (obj , outfile ,
64
66
indent = options .indent ,
67
+ ensure_ascii = not options .no_escape ,
65
68
sort_keys = options .sort_keys ,
66
69
)
67
70
outfile .write ('\n ' )
You can’t perform that action at this time.
0 commit comments