Solve the Android Studio garbled problem, androidstudio
There are several types of garbled characters in Android Studio. First, garbled characters are displayed in different IDE windows, such as the logcat filtering box and the comments box submitted by SVN. Second, set Chinese characters in the code, and garbled characters are displayed on the UI of the real machine, such as xxx. setText ("Chinese ").
I. IDE garbled characters
The filter box on the Right of Log Level clearly displays Chinese characters and garbled characters.
File> Settings> Appearance & Behavior> Appearance, change default fonts to Microsoft YaHei (change to other SimHei, and SimSun is fine, but I personally think looks better ).
After setting, you can immediately see the Chinese characters in the filter box.
2. Chinese characters in the code
Set Chinese characters in the Code. garbled characters are displayed on controls such as TextView on the real machine, such as xxx. setText ("Chinese ").
The project I joined was originally created by Eclipse. Once there was a garbled problem, my colleagues said they could change the encoding in Properties to GBK.
No matter whether he is right or wrong, but it is true that he will not be garbled with such a change. But because I am using Android Studio, what should I do?
In File> Settings> Editor> File Encodings, Project Encoding is changed to UTF-8. to unify the specification, I also set other Encoding items to UTF-8.
Iii. garbled Gradle
Finally, if a friend encounters a problem where Gradle prompts Chinese garbled characters, refer to http://blog.csdn.net/sljjyy/article/details/11976099.