--- /dev/fd/63 2017-08-16 13:46:07.901340419 +0800 +++ Lib/json/tool.py 2017-08-16 13:30:29.616928043 +0800 @@ -27,11 +27,14 @@ help='write the output of infile to outfile') parser.add_argument('--sort-keys', action='store_true', default=False, help='sort the output of dictionaries alphabetically by key') + parser.add_argument('--no-escape', action='store_true', default=False, + help='no characters escaped') options = parser.parse_args() infile = options.infile or sys.stdin outfile = options.outfile or sys.stdout sort_keys = options.sort_keys + ensure_ascii = not options.no_escape with infile: try: if sort_keys: @@ -42,7 +45,7 @@ except ValueError as e: raise SystemExit(e) with outfile: - json.dump(obj, outfile, sort_keys=sort_keys, indent=4) + json.dump(obj, outfile, ensure_ascii=ensure_ascii, sort_keys=sort_keys, indent=4) outfile.write('\n')