0

My mp3 file has id3 tags which can be displayed in a terminal on my debian buster linux for example by using the program id3tool or id3. If my shell (xfce4-terminal) has a set default character encoding to UTF-8, the output of id3tool looks like this:

Filename: test.mp3
Song Title: Qu�l Dich Fit
Artist:     Wise Guys
Album:      Frei!
Track:      16
Year:       2008
Genre:      Rock (0x11)

By choosing a default character encoding for the terminal to ISO-8859-1, the output of id3tool is:

Filename: test.mp3
Song Title: Quäl Dich Fit
Artist:     Wise Guys
Album:      Frei!
Track:      16
Year:       2008
Genre:      Rock (0x11)

The invalid character of the title name is gone and replaced with the correct one. I want to be able to see the correct song title without having to switch the terminal encoding.

The mp3 file is not a text file. It is a binary with id3 tags, which apparently are encoded in ISO-8859-1. The command

file -bi test.mp3 

yields

audio/mpeg; charset=binary

Can I transform the encoding of this file to UTF-8? "iconv" works only for text files.

What else should I do to be able to work with the id3 tags of my mp3 files without invalid characters?

3
  • 2
    extract metadata to txt file with ffmpeg, convert it with iconv, then re-add. Commented Aug 17, 2020 at 21:11
  • ... or even read with id3tool and write back with id3tool. Commented Aug 17, 2020 at 22:15
  • That does the trick! Thanks to Ipor and Philip. I did it with id3tool. I wrote a bash script which I can call in a shell with either ISO-8859-1 or UTF-8 encoding and end up with a file that displays just fine in an UTF-8 encoded shell. Ipor, please copy your comment into an answer, just so I can mark this question as solved. Commented Aug 19, 2020 at 12:17

1 Answer 1

0

extract metadata to txt file with ffmpeg, convert it with iconv, then re-add.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.