From 66f0cd8fe52fe5c4bf0bf3c55bd9a1e5a7ab161e Mon Sep 17 00:00:00 2001 From: Michiel Sikma Date: Sat, 26 Nov 2016 20:16:29 +0100 Subject: [PATCH] Script to get JSON output for Japanese characters --- scripts/jsonjp.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/jsonjp.py diff --git a/scripts/jsonjp.py b/scripts/jsonjp.py new file mode 100755 index 00000000..076ed07b --- /dev/null +++ b/scripts/jsonjp.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +# prints JSON-usable japanese +# example: $ ./jsonjp.py モクロー +# output: "\u30e2\u30af\u30ed\u30fc" +import json +import sys +print(json.dumps(sys.argv[1])) \ No newline at end of file