Skip to content

Instantly share code, notes, and snippets.

@miy4
Created November 16, 2021 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miy4/625b6b644be719e2f32d5b504ec15ec8 to your computer and use it in GitHub Desktop.
Save miy4/625b6b644be719e2f32d5b504ec15ec8 to your computer and use it in GitHub Desktop.
Print Unicode codepoint in Bash
#!/bin/bash
# http://mywiki.wooledge.org/BashFAQ/071
# > If the leading character is a single-quote or double-quote,
# > the value shall be the numeric value in the underlying codeset
# > of the character following the single-quote or double-quote.
printf 'U+%04x\n' "'a"
printf 'U+%04x\n' "'あ"
$ ./print-unicode-codepoint.bash
U+0061
U+3042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment