unmappable character for encoding UTF-8. again.

Sorry guys, but this "unmappable character" issue is driving me batty.
Windows 7
jdk 1.6.0_29
Intellij IDEA 11.1.1: 117.117
Build: Maven 3.0.4

The maven build on the command line has no issues.
Changing the project or file encoding or pom.xml to windows-1252 has no effect. still get the same error.

when i tried to create a basic project with the two strings that it was complaining about, it had no issues.

what am i missing?

Thanks,
Nilesh

4 comments
Comment actions Permalink

Sorry, I don't understand where do you see thar error? Does your pom.xml contatin non-latin characters?

0
Comment actions Permalink

Sorry about the delay - got pulled into other projects.
So the issue happens during the IDEA compilation
unmappable character issue.png
As i mentioned before, i tried changing the encoding on the specific file to windows-1252, but that didn't fix it.
I am not terribly conversant with maven and how IDEA uses it - if i am trying to run my app, and haven't chosen any maven goals to run, does IDEA still use maven and the pom to do the build?
just trying to understand why it still thinks it's a UTF-8 file if i have specified the encoding to windows-1252...
Thanks,
Nilesh

p.s: what drives me further nuts :) is that even if i comment out the offending lines, it STILL gives me a compilation error on those lines! how is that possible??

0
Comment actions Permalink

Hi Nilesh,

When compiling, per-file encoding is effective only for resource compiler. Java compiler pays attention to project and IDE encoding settings.
First project encoding is checked (see Settings | File Encodings). If specified, it is used to compile java files. If project encoding is not set, then IDE encoding is used.

So to solve the problem it is enough to specify correct encoding for the project.

> that even if i comment out the offending lines, it STILL gives me a compilation error on those lines! how is that possible??

This is because javac still reads the file and if it is told to read the file using encoding that is different from the one the file actually uses, you'll be getting errors like this.


Eugene.

0
Comment actions Permalink

got it. works now. thanks!

0

Please sign in to leave a comment.