-
-
Save lebensterben/8e5b56228cc5db67176bc53bc9603d85 to your computer and use it in GitHub Desktop.
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
#-*- mode: shell-script -*- | |
# Print Strings Given Their Unicode Representation | |
#from_unicode() { | |
if [[ $# -eq 0 ]]; then | |
cat << EOF | |
Usage: from_unicode Unicode [...] | |
Print one or multiple strings according to their unicode representation. | |
At least one argument should be given, and each argument shall be quoted if it contains whitespaces. | |
Examples: | |
'\xe2\x98\xa0 -> ☠ | |
'\xe5\x90\xbc' -> 吼 | |
'\x61\x73\x64\x66' -> asdf | |
EOF | |
else | |
for i in $@; do | |
echo -n $i | odprintf -e "$i\n" | |
done | |
unset i | |
fi | |
#} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment