Last active
July 31, 2017 17:54
-
-
Save ulisseslima/d614a31b73947471e04176b0951527bd to your computer and use it in GitHub Desktop.
Unicode Espace Generator for Java Properties (Bash wrapper for native2ascii JDK tool)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tmp=tmp-unicode-escape.txt | |
tmp_out=out-$tmp | |
text="$1" | |
if [ ! -n "$text" ]; then | |
echo "first arg must be the text to escape" | |
exit 1 | |
fi | |
echo "$text" > $tmp | |
native2ascii -encoding utf8 $tmp $tmp_out | |
cat $tmp_out | |
rm $tmp $tmp_out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: