If your music player does not display some MP3 tracks correctly (e.g., with garbled symbols), it is most likely that the character encoding of ID3 tags is not supported on your Linux system. You can often encounter this problem when song titles or artist names are written in Cyrillic, Greek, Chinese, Japanese or Korean characters.
To solve this problem, you need to convert character encoding of ID3 tags to UTF-8/Unicode. The very tool that can do such conversion is mid3iconv command-line tool. Using mid3iconv, you can convert ID3 tags from any arbitrary character encoding to Unicode.
Install Mid3iconv on Linux
The mid3iconv tool is part of python-mutagen package, which is universally available on major Linux platforms.
Debian, Ubuntu or Linux Mint:
CentOS, Fedora or RHEL:
Convert ID3 Character Encodings with Mid3iconv
The typical command-line usage of mid3iconv is as follows.
The above command converts the character encoding of input MP3 file's ID3 tag from <source-encoding> to Unicode. If you want to "dry-run" the conversion without actually modifying a MP3 file, you can add "-p" option.
For example, to convert ID3's character encoding from CP1252 to UTF-8/Unicode:
Without "-p" option, the converted ID3 tag will be overwritten to an input MP3 file.
Fix Broken Characters in MP3 Song Titles and Artist Names
Now let's try to fix broken characters in MP3 ID3 tags with mid3iconv.
The first thing you need to do is to identify the character encoding used by your MP3 files. You may be able to guess their character encoding if you know where they are from. For example, if MP3 files are Japanese songs, the encoding may be Shift-JIS or EUC-JP, while Chinese songs may be encoded with GB 2312 or GBK, etc. If you are not sure, you can use mid3iconv's "dry-run" option to find it out.
That is, choose any encoding from:
and apply conversion (with "dry-run" option):
If the output is readable, that means you guessed a source encoding correctly.
Once you know what ID3 encoding your MP3 files are using, use the following command to batch-convert ID3 character encoding for all your MP3 files.
For example, if ID tags of your MP3 songs are encoded with EUC-KR (Korean characters), use the below command to fix broken characters.
Verify that MP3 files are displayed correctly.
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!