Using Mac OSX and if there is a file encoded with UTF-8 (contains international characters besides ASCII), wondering if any tools or simple command (e.g. in Python 2.7 or shell) we can use to find the related hex (base-16) values (in terms of byte stream)? For example, if I write some Asian characters into the file, I can find the related hex value.
My current solution is I open the file and read them byte by byte using Python str. Wondering if any simpler ways without coding. :)
Edit 1, it seems the output of od
is not correct,
cat ~/Downloads/12
1
od ~/Downloads/12
0000000 000061
0000001
Edit 2, tried od -t x1
options as well,
od -t x1 ~/Downloads/12
0000000 31
0000001
thanks in advance, Lin