I have a mixed-encoding source tree and I'm getting the warning above for some of my source files. I managed to sucessfully set the encoding for those files to ISO 8859-1 and, after invalidating IDEA's caches, they now display correctly in the editor. However, when I compile, I still get the error message.
Production builds use ant and it's not an issue there, but it means I can't "make" in the IDE. Is there a way to get IDEA to compile these correctly, or failing that, drop the error down to a warning?
"error: unmappable character for encoding UTF-8" means, java has found a character which is not representing in UTF-8. Hence open the file in an editor and set the character encoding to UTF-8. You should be able to find a character which is not represented in UTF-8. Take off this character and recompile.
Go to common tab of RUN/DEBUG configuration in eclipse change encoding to UTF-8. Show activity on this post. Window > Preferences > General > Content Types, set UTF-8 as the default encoding for all content types. Window > Preferences > General > Workspace, set "Text file encoding" to "Other : UTF-8".
I solved this issue adding this property in IntelliJ option panel Compiler/Java Compiler :
Additional command line parameters : -encoding ISO-8859-1
I have UTF-8 encoding in encoding.xml as follows, but still not working. keeps getting error "Error: java: error: unmappable character (0xFE) for encoding UTF-8"
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With