od output is confusing This isn't a deploy related question, but I believe it belongs here.
I've found out about the od tool yesterday, and began to fiddle with it.
The question is about utf-8 encoding. See the examples:
~ $ echo -n á | od -x
0000000 a1c3
0000002
~ $ echo -n áá | od -x
0000000 a1c3 a1c3
0000004
~ $ echo -n ác | od -x
0000000 a1c3 0063
0000003

# This is the issue
~ $ echo -n cá | od -x
0000000 c363 00a1
0000003

So á translates to c3 a1 correctly in each test besides the last, which begins with an ascii char. Why isn't the output of the last test 0063 a1c3 (i.e. invert the one before the last) ?
I've tried to read from a utf-8 file and the result is the same.
Thanks in advance.
Problem solved:
It's because of endianess of output.
There is an option --endian which by default is little.
The example string was cá, which translates to 63 C3 A1 utf-8 encoded:
~ $ echo -n cá | od --endian=big -x
0000000 63c3 a100
0000003

(The -n prevents \n in the end of string, making last byte 00)
So it's exactly the same output, but with bytes inverted:
~ $ echo -n cá | od --endian=little -x
0000000 c363 00a1
0000003

(c363 instead of 63c3 and so forth).