英文:
Jenkins Maven encoding and languages
问题
我在JENKINS和MAVEN方面遇到了编码问题。
我正在进行测试,其中一个测试是将语言更改为本地语言(罗马尼亚语)。
如果我在pom.xml中使用UTF-8,编译时会出现“无法映射的字符”错误,我已将编码更改为“cp1252”,这种编码不会给我带来错误,但它也找不到使用本地语言的元素,我得到的是ROM?‚NÄ‚,而不是ROMÂNĂ。
是否有任何方法可以解决这个涉及多种编码的问题?
英文:
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?
答案1
得分: 1
The unmappable character error indicates a mismatch between the 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 this link.
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论