Damian Brunold
iconv und hexdump
2010-05-17 14:47
Mit iconv kann man bequem zwischen verschiedenen Encodings konvertieren:
iconv -f utf-8 -t iso-8859-1 text.txt > text1.txt
Das Tool hexdump ist eine schöne Alternative zu od -c um die binären Daten einer Datei anzuzeigen. Die Option -C liefert kombiniert ASCII und HEX:
damian@damian2:~$ cat text.txt test hähä höhö haha
damian@damian2:~$ hexdump -C text.txt 00000000 74 65 73 74 20 20 68 c3 a4 68 c3 a4 20 68 c3 b6 |test h..h.. h..| 00000010 68 c3 b6 20 68 61 68 61 0a |h.. haha.| 00000019
damian@damian2:~$ hexdump -C text1.txt 00000000 74 65 73 74 20 20 68 e4 68 e4 20 68 f6 68 f6 20 |test h.h. h.h. | 00000010 68 61 68 61 0a |haha.| 00000015
damian@damian2:~$ od -c text.txt 0000000 t e s t h 303 244 h 303 244 h 303 266 0000020 h 303 266 h a h a \n 0000031
damian@damian2:~$ od -c text1.txt 0000000 t e s t h 344 h 344 h 366 h 366 0000020 h a h a \n 0000025