Android Studio sets the project Module encoding to solve the problem of garbled characters during the running of the Android Studio project. moduleandroid
The project Setting logic of Android Studio is very different from that of Eclipse. The operation is File-> Setting-> File Encodings, and then you can set it ,:
Open the module build. gradle file to modify the encoding used by the compiler. The above settings only affect the encoding of the file content you see in the editor view in the IDE. The encoding used by the compiler also needs to be set separately. Otherwise, gradle uses UTF-8 encoding by default and the actual encoding of the file is inconsistent, leading to garbled characters during program running.
Gradle configuration encoding is configured in the build. gradle script file. You can add up and down configurations.
Android {... compileOptions {encoding "GBK "}}
If you only set the Encoding of a File, open the File directly in Android Studio and right-click the File Encoding option.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.