Comments in code show garbled problem after importing Eclipse code from Android Studio

Source: Internet
Author: User

After seeing the garbled characters, I realized that it might be wrong coding method. In the Settings menu of Android Studio, find the place to edit the code. As follows:
file > Settings > Editor > File Encodings Project Encoding to GBK, and for the sake of uniform specification, I also set the other Encoding items to GBK.

-----------------------------------------------------------------------------------------------

But after the operation, the program in Chinese again garbled situation.

Ask questions in CSDN's Andorid forum and don't get the answers you want. See post: http://bbs.csdn.net/topics/391818489. Finally, find a solution on the Internet, as follows:

Apply plugin: ' Android ' dependencies {compile filetree (dir: ' Libs ', include: ' *.jar ') Compile project (': Appcompat_v7 ')} android {compilesdkversion buildtoolsversion "20.0.0" Android {Compileoptions.enco Ding = "GBK"}/////////added content, can be deployed to the device on the display of Chinese characters garbled problemcompileoptions {sourcecompatibility javaversion.version_1_7 targetcompatibility JavaVersion.V Ersion_1_7} sourcesets {main {manifest.srcfile ' androidmanifest.xml ' JAV A.srcdirs = [' src '] resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscript . srcdirs = [' src '] res.srcdirs = [' res '] assets.srcdirs = [' Assets ']}//Mo          ve the tests to Tests/java, tests/res, etc ... Instrumenttest.setroot (' tests ')//Move The build types to build-types/<type>//For instance, Build-types/debug/java, Build-types/debug/androidmanifest.xml, ...//This moves T Hem out of them default location under src/<type>/... which would//conflict with src/being used by the main source set.          Adding New build types or product flavors should be accompanied//by a similar customization. Debug.setroot (' Build-types/debug ') release.setroot (' Build-types/release ')}}

Comments in code show garbled problem after importing Eclipse code from Android Studio

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.