Remove old scripts, add a few helper scripts in Bash for compatibility

This commit is contained in:
Michiel Sikma
2020-02-17 00:04:54 +01:00
parent 738b66576d
commit 3ae1cdab46
9 changed files with 149 additions and 747 deletions

View File

@@ -1,8 +1,13 @@
#!/usr/bin/env python3
# prints JSON-usable japanese
# example: $ ./jsonjp.py モクロー
# output: "\u30e2\u30af\u30ed\u30fc"
# Prints input with non-ASCII characters converted to Unicode escape sequences.
# Example:
# $ ./jsonjp.py モクロー
# "\u30e2\u30af\u30ed\u30fc"
import json
import sys
print(json.dumps(sys.argv[1]))
if len(sys.argv) <= 1:
print('usage: jsonjp.py TEXT')
sys.exit(1)
print(json.dumps(sys.argv[1]))