0

I have issue with JENKINS and MAVEN regarding encoding. I am doing tests and one of the tests is changing language to domestic language (Romanian)

If I use UTF-8 in pom.xml I get "unmappable character" error when compiling, I have changed encoding to "cp1252", this encoding doesn't give me that error but it also doesn't find the elements that are using domestic language, I get ROM?‚NÄ‚ instead of ROMÂNĂ.

Is there any way to resolve this issue with multiple encoding?

  • [This](https://stackoverflow.com/a/8979120/4175515) answer your question? – Joao Vitorino Aug 24 '20 at 13:56
  • 1
    Does this answer your question? [Error: unmappable character for encoding UTF8 during maven compilation](https://stackoverflow.com/questions/8978013/error-unmappable-character-for-encoding-utf8-during-maven-compilation) – Joao Vitorino Aug 24 '20 at 13:57
  • You need to find out which codepage was used to save your source files, or convert them to UTF-8. – Mark Rotteveel Aug 24 '20 at 15:17

1 Answers1

1

The unmappable character error indicates a mismatch between Character encodings of input files and the Maven tooling.

Did you set the encoding using this property? This ensures that all plugins will use UTF-8.

<project>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
...

Also ensure that your source files are actually UTF-8. For more tips, see https://stackoverflow.com/a/8979120/8092868

Joep Weijers
  • 1,844
  • 12
  • 19
  • the problem I get when using UTF-8 is some characters are causing maven to give "unmappable character" error when compiling – Vedran Zenzerović Aug 24 '20 at 13:45
  • If you tell Maven to use UTF-8, then your input files must also be UTF-8. You can verify the character encoding in e.g. Notepad++ in the bottom right of the status bar. – Joep Weijers Aug 24 '20 at 13:56