Android Studio解决Java程序输出中文乱码

 

经查阅资料,发现需要手动在build.gradle中添加代码

//新版

tasks.withType(JavaCompile) { options.encoding = "UTF-8" }

 

 

//旧版,以gradle-1.12为例

tasks.withType(Compile) { options.encoding = "UTF-8" }

posted on 2017-10-28 14:45  yaolunhui  阅读(1291)  评论(0编辑  收藏  举报

导航