Yep - use hexdump
, like this:
$ echo -n i | hexdump
Which will output something like this:
0000000 0069
0000003
For something more formatted, you could do this:
$ echo ü | hexdump | awk '{print "\\x"toupper(substr($2,3,4)) "\\x"toupper(substr($2,0,2)) "\\x"toupper(substr($3,3,4))}' | head -1
which will print out this:
\xC3\xBC\x0A
Code taken from here: How do you echo a 4-digit Unicode character in Bash?