Print out unicode values of stdin

command linedebuggingtext;unicode

I use od to print me the octal or hex of a file/stdin/string. This lets me see the ASCII, or UTF-8 encoded, values of my stdin.

But we don't live in ASCIIland anymore. Is there any command that will print out the unicode values/codepoints for the (presume) utf-8 encoded input? I want to know what unicode characters I'm seeing?

Best Answer

You can use this if you are on a little endian system:

iconv -f utf-8 -t ucs-4le | od -tx4

or this if you are on a big endian system:

iconv -f utf-8 -t ucs-4be | od -tx4
Related Question