Android Studio project encoding is set to GBK or UTF-8 Chinese garbled and Eclipse project encoding settings

  • Android Studio project encoding is set to GBK or UTF-8 Chinese garbled

1. Open File->Setting->Editor->File Encoding to set the encoding (only affect the encoding of the file content you see in the editor view in the IDE)

    IDE Encoding: ide encoding
    Project Encoding: project encoding
    File or Director Encoding: each file or directory encoding
    Property File Encoding: property file encoding

2. Open the build.gradle (Module: app) file of the module to modify the code used by the compiler (the compiler code is affected)

    compileOptions {
        encoding "GBK"
    }

  • Eclipse project encoding settings

1. Right click on the project -> Properties ->Resoure->Text file encoding ->Other ->GBK or UTF-8

Guess you like

Origin blog.csdn.net/chenhao0568/article/details/106600230