Skip to content

Instantly share code, notes, and snippets.

@aerobounce
Created April 9, 2020 07:03
Show Gist options
  • Save aerobounce/e76fdb53c26b53a52f4244431256f810 to your computer and use it in GitHub Desktop.
Save aerobounce/e76fdb53c26b53a52f4244431256f810 to your computer and use it in GitHub Desktop.
Retrive Unicode Character suitable to use with FontForge script
#!/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