Solve the Android Studio garbled problem, androidstudio

Source: Internet
Author: User

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.

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.