Skip to content

Instantly share code, notes, and snippets.

@louisje
Created November 11, 2020 02:09
Show Gist options
  • Save louisje/badcc3df681ebc3fdb841bd234625a0d to your computer and use it in GitHub Desktop.
Save louisje/badcc3df681ebc3fdb841bd234625a0d to your computer and use it in GitHub Desktop.
#!/bin/sh
if test -z "$1"; then
echo "Usage: `basename $0` <char>"
exit
fi
echo -n "$1" \
| iconv -f utf8 -t utf32be \
| xxd -p \
| sed -r 's/^0+/0x/' \
| xargs printf 'U+%04X\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment