转换前的财产:
CONNECTION_ERROR_OR_SESSIO = Erreur deconnexionoudépassementdesession!
转换后的财产:
CONNECTION_ERROR_OR_SESSIO = Erreur de connexion ou d \ u00a6dassement de session!
插件将é转换为\ u00c3 \ u00a9而不是\ u00e9
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<id>native2ascii-utf8-resources</id>
<goals>
<goal>native2ascii</goal>
</goals>
<phase>validate</phase>
<configuration>
<dest>src/temp</dest>
<src>src</src>
<ext>.properties</ext>
<encoding>ISO-8859-1</encoding>
<includes>MessageResource_fr_FR.properties
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
这只发生在Linux上。在Windows上构建项目时,它可以正常工作。有什么想法吗?
答案 0 :(得分:0)
这意味着在某个步骤中,您的构建链会读取一个文件,假设它是ISO-8859-1,而该文件实际上是以UTF-8编码的。
é
是 U + 00E9 - 带有急性的拉丁文小写字母
该字符的UTF-8编码为"\xc3\xa9"
。如果您将这些字节读回ISO-8859-1,则结果是两个字符 U + 00C3 'Ã'
和 U + 00E9 'é'
。这些字符是您在转换后的文件中看到的字符。
如果您支持很多语言,那么您在ISO-8859-1中对所有语言进行编码的概率就会非常小。如果可能的话,只需将所有这些文件编码为UTF-8。