I'm trying to understand how ID3 tags work, so, after reading some documentation, I started to look at some mp3's raw data. Vim is usually my editor of choice, so, after some googling, I found out I could use xxd to see an hex representation of my files by invoking
:%!xxd
Everything worked fine, but when I put everything back in order with
:%!xxd -r
and quit, I found out that the file was modified; vlc could no longer play it, and diff told me the files differed. I thought I modified something by accident, but further experiments showed me that even opening the file and using xxd and then xxd -r changes somehow the file.
Why is that? How can I prevent it from happening? Am I doing something wrong?
:%!xxd -r > /path/to/new/file
– Tito