On 24/02/18 08:53, Peng Yu wrote: > It seems that `od` does not respect the unicode. > > Is there a tool (maybe different from od) that can print the code in > odd lines and the unicode character in even lines? Thanks. > > $ od -xc <<< 'exámple' > 0000000 7865 a1c3 706d 656c 000a > e x ? ? m p l e \n > 0000011 > > In this particular case, I'd like it to print something like the > following (positions are omitted). Is there a tool for doing so? > > 65 78 c1 6d 70 6c 65 0a > e x á m p l e \n
od doesn't support that at present. Perhaps we could have another -t option to support that. Note we have to consider alignment. Consider: $ od -An -tx1 -ta -tc <<< 'exámple' 65 78 c3 a1 6d 70 6c 65 0a e x C ! m p l e nl e x 303 241 m p l e \n cheers, Pádraig
