diff options
author | Stefan Kögl <stefan@skoegl.net> | 2021-03-04 20:08:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 20:08:29 +0100 |
commit | cc37e25ee26add6989b6138085973f2231182549 (patch) | |
tree | e0eee3753a354820e913d6e2e7958a0d16f0d3e2 /bin/jsonpatch | |
parent | dbea3db33298da4ec41197b07612c42580e132e4 (diff) | |
parent | 974d54f393de78ce21bee9897cee8f1ace5813ee (diff) | |
download | python-json-patch-cc37e25ee26add6989b6138085973f2231182549.tar.gz |
Merge pull request #127 from Genzer/master
Add support for preserving Unicode characters in jsonpatch CLI
Diffstat (limited to 'bin/jsonpatch')
-rwxr-xr-x | bin/jsonpatch | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/jsonpatch b/bin/jsonpatch index 3f01738..a7adf29 100755 --- a/bin/jsonpatch +++ b/bin/jsonpatch @@ -24,7 +24,8 @@ parser.add_argument('-i', '--in-place', action='store_true', help='Modify ORIGINAL in-place instead of to stdout') parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + jsonpatch.__version__) - +parser.add_argument('-u', '--preserve-unicode', action='store_true', + help='Output Unicode character as-is without using Code Point') def main(): try: @@ -72,8 +73,8 @@ def patch_files(): # By this point we have some sort of file object we can write the # modified JSON to. - - json.dump(result, fp, indent=args.indent) + + json.dump(result, fp, indent=args.indent, ensure_ascii=not(args.preserve_unicode)) fp.write('\n') if args.in_place: |