Solve the problem that Chinese characters will be garbled after git submission


Recently, a strange thing happened. Of course, there are many strange things happened to vegetable chicken

Originally, when a. Properties file was committed in idea, it looked at diff and found no exception. However, when it was submitted to gitlab, it was found that all the Chinese characters of. Properties have become the ASCII code of \\\\\\\\\\\\\.

Then I check the differences between the previous version and the show history of idea and find that these Chinese characters are OK??!!

Then there is a meal of Baidu, Bing

Finally, it is found that transparent native to ASCII conversion is selected in the settings

Then someone on the Internet explained as follows:

Translate native to ASCII conversion means: automatically convert ASCII code.

His working principle is: when inputting text in the file, he will automatically convert it to unicode encoding, and then when sending the file in idea, he will automatically turn back the text to display.

This is to prevent garbled files…


After you cancel the check, you can see that all Chinese is converted to ASCII; 2. The code pulled by other team members is ASCII; 3. Push to Git is ASCII. That is to say, for example, when a colleague uses eclipse to write notes in Chinese, after you edit them, push will cover all the original Chinese Notes in ASCII. This is the impact of checking…

OK, this file looks ok, but if you select it, it is an ASCII file stored locally. However, the file on Git is not in this format. You can try to open the local. Properties file with Notepad + +, and you will find that it has no Chinese,,

The good reason is over, how to solve it?

1. First of all, clear the check of transparent native to ASCII conversion. You will find that the local character has changed from Chinese character to ASCII encoding.

2. I definitely want to withdraw the recommended article just submitted

3. Return the. Properties file to a file of non ASCII format (backup it well)

4. Normal submission process of balabalabala

The above solution to the problem that Chinese characters will be garbled after git submission is the whole content shared by Xiaobian. I hope it can give you a reference, and I hope you can support developer more.