Resolve text file contents and filename mp3 tag garbled problem

Source: Internet
Author: User
Keywords Garbled tagged resolved nbsp; Environment variables
Tags close code creating default directory environment environment variables etc

Users who move from windows to Ubuntu often find themselves in a frequently garbled problem with windows in creating/downloading/saving files (Kubuntu more likely to have problems). and use the default player to open the previous music files (MP3, etc.), the chance of garbled is close to 100%. This problem occurs because the file or file tag encoding is not the default UTF8 of the system, and the Windows system defaults to GBK. As long as the file code to do the conversion to solve the problem of garbled.

Graphical interface Tools

Use Easytag to fix MP3 garbled installation method:

sudo apt install easytag exfalso

Click "Application" to open Easytag
Specify your MP3 directory in the Preferences browser
ID3 tab SET Select Http://www.aliyun.com/zixun/aggregation/23115.html "> Simplified Chinese
Write ID3v2 tags are also checked UTF-8

And then restart Easytag,
Then double-click on the main screen of your song directory, save, your mp3 in the player will be able to display Chinese.

Note: Easytag is not omnipotent, before the modification, it is best to change the music file name to facilitate the identification of the form, such as: "Singer name-track name", these can be "listening to" a class of software to achieve. In this way, even if there is garbled after the change, there is a chance to remedy. Playing with the Winamp in wine is also a good choice.

command-line based tools

Tools to use

sudo apt install convmv iconv python-mutagen

To convert a file encoding, go to the directory where you want to convert the file

Convert file name from GBK to UTF8

Convmv-r-F cp936-t UTF8--notest--nosmart *

Convert file contents from GBK to UTF8

Iconv-f gbk-t UTF8 $i > NewFile

Convert MP3 label encoding

Find. -iname "*.mp3"-execdir mid3iconv-e GBK {} \;

Note: Make sure you have write permission on the required transform file

Modify Variable method

Using a tool to modify a label for a small number of files can solve the garbled problem, but for the new music file needs to be converted again. ArchLinux Wiki provides a way to modify an environment variable to be worth referencing

For example, using GStreamer as the back-end player Rhythmbox, you can add the following in the system environment variable or user's environment variable:

Export gst_id3_tag_encoding=gbk:utf-8:gb18030
Export gst_id3v2_tag_encoding=gbk:utf-8:gb18030

Other players can refer to ArchLinux's wiki's other instructions.

Note: Because modifying the environment variable to the system influence is big, the user may consider using gedit and so on editor only modifies ~/.profile, if the modification ~/.profile invalid, may consider modifies the system environment variable/etc/profile (needs the Administrator authority, please carefully operation).

Related Article

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.