Skip to content

Instantly share code, notes, and snippets.

@lebensterben
Created June 18, 2019 00:59
Show Gist options
  • Save lebensterben/8e5b56228cc5db67176bc53bc9603d85 to your computer and use it in GitHub Desktop.
Save lebensterben/8e5b56228cc5db67176bc53bc9603d85 to your computer and use it in GitHub Desktop.
#-*- 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