Created
April 9, 2020 07:03
-
-
Save aerobounce/e76fdb53c26b53a52f4244431256f810 to your computer and use it in GitHub Desktop.
Retrive Unicode Character suitable to use with FontForge script
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
#!/usr/bin/env bash | |
set -Ceu | |
unicode() { | |
for i in "$@"; do | |
echo -n "$i" | # -n ignore trailing newline | |
iconv -f utf8 -t UTF-32BE | # UTF-32 big-endian happens to be the code point | |
xxd -p | # -p just give me the plain hex | |
sed -e 's/^0000/0u/' | # remove leading 0's, replace with 0x | |
sed -e 's/\n/ /' # remove leading 0's, replace with 0x | |
done | |
} | |
unicode a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment