After importing my project from eclipse into android studio i have got the following error :
Error: unmappable character for encoding UTF-8
Android Studio : 0.5.8
This question is related to
android
utf-8
android-studio
I have the problem with encoding in javadoc generated by intellij idea. The solution is to add
-encoding UTF-8 -docencoding utf-8 -charset utf-8
into command line arguments!
UPDATE: more information about compilation Javadoc in Intellij IDEA see in my post
Adding the following to build.gradle solves the problem :
android {
...
compileOptions.encoding = 'ISO-8859-1'
}
Check all 'C' characters. There are may be some cyrillic 'C's in english-looking word.
Reason for this is that in both english and russian keyboards 'C' occupies same physical button.
Add system variable (for Windows) "JAVA_TOOL_OPTIONS" = "-Dfile.encoding=UTF8".
I did it only way to fix this error.
A few encoding issues that I had to face couldn't be solved by above solutions. I had to either update my Android Studio or run test cases using following command in the AS terminal.
gradlew clean assembleDebug testDebug
P.S your encoding settings for IDE and project should match.
Hope it helps !
In Android Studio resolved it by
ISO-8859-1
UTF-8
and the same case to Default encoding for properties files.If above answeres did not work, then you can try my answer because it worked for me.
Here's what worked for me.
This should fix the issue.
1/ Convert the file encoding
File -> Settings -> Editor -> File encodings -> set UTF-8 for
Press OK
2/ Rebuild Project
Build -> Rebuild project
Source: Stackoverflow.com