2

I've got a text file that I'm trying to debug an encoding issue in. I ran the file through od -c and got the following output:

3457540  ,   "   t   e   x   t   "   :   "   302 241   Q   u 303 251

My understanding from the man page is that -c "select[s] ASCII characters or backslash escapes." I guess I don't understand what a backslash escape is. I would have assumed it to be a C-string style escaped character, such as \0 or \n. However, I'm getting values (302 and 303) that are clearly out of the range of a byte. Could somebody explain what's happening here?

1 Answers1

5

Those numbers are octal (base 8) It'll only backslash something that has a symbolic name (\n, \b, \t, etc.)

(I prefer hd -- hexdump -C -- myself.)

Ricky
  • 1,377
  • Ah, I forgot that a lot of these tools were written for octal first. That would explain the oddball numbers. Thanks, hd looks like the better option. FYI, the -c switch is lower case (at least on Ubuntu). – Eric Andres Mar 14 '14 at 21:38
  • No, lowercase "c" is different from uppercase for the parent hexdump application. – Ricky Mar 14 '14 at 21:41
  • You're right. I was thinking hd was an alias for hexdump. Thanks again. – Eric Andres Mar 14 '14 at 21:49