Android的工作室:编码UTF-8的不可映射的字符 [英] Android Studio : unmappable character for encoding UTF-8

查看:1784
本文介绍了Android的工作室:编码UTF-8的不可映射的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

导入我的项目,从偏食到Android的工作室后,我已经得到了以下错误:

After importing my project from eclipse into android studio i have got the following error :

Error: unmappable character for encoding UTF-8

Android的工作室:0.5.8

推荐答案

我有同样的问题,因为有与Windows-1251编码和西里尔意见的文件。在Android的工作室,是基于IntelliJ IDEA的,你可以解决它在两个方面:

I had the same problem because there was files with windows-1251 encoding and Cyrillic comments. In Android Studio which is based on IntelliJ IDEA you can solve it in two ways:

转换文件编码成UTF-8或

a) convert file encoding to UTF-8 or

B)设置正确的文件中的编码您的 build.gradle 的脚本:

b) set the right file encoding in your build.gradle script:

android {
    ...
    compileOptions.encoding = 'windows-1251' // write your encoding here
    ...

要转换文件编码使用菜单在IDE的右下角。首先选择正确的文件编码 - > preSS的刷新的 - >选择UTF-8 - > preSS的转换

To convert file encoding use the menu at the bottom right corner of IDE. Select right file encoding first -> press Reload -> select UTF-8 -> press Convert.

另外阅读<一个href="http://blog.jetbrains.com/idea/2013/03/use-the-utf-8-luke-file-encodings-in-intellij-idea/">Use在UTF-8,卢克!在IntelliJ IDEA的文件编码

这篇关于Android的工作室:编码UTF-8的不可映射的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆