gpt4 book ai didi

linux - 在 Linux 上构建项目时,native2ascii 无法正确转换

转载 作者:太空宇宙 更新时间:2023-11-04 13:04:20 26 4
gpt4 key购买 nike

转换前的属性:

CONNECTION_ERROR_OR_SESSIO=连接错误或 session 中断!

转换后的属性:

CONNECTION_ERROR_OR_SESSIO=连接或 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 上构建时,它工作正常。有什么想法吗?

最佳答案

这意味着在某个步骤中,您的构建链会读取一个假定为 ISO-8859-1 的文件,而该文件实际上是以 UTF-8 编码的。

éU+00E9 — 带尖音符号的拉丁文小写字母 E

该字符的 UTF-8 编码是 "\xc3\xa9"。如果您将这些字节作为 ISO-8859-1 读回,结果是两个字符 U+00C3 'Ã'U+00E9 'é'。这些字符就是您在转换后的文件中看到的字符。

如果您支持多种语言,那么您可以在 ISO-8859-1 中对所有语言进行编码的可能性微乎其微。如果可能的话,将所有这些文件编码为 UTF-8。

关于linux - 在 Linux 上构建项目时,native2ascii 无法正确转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33106641/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com