I have tried encoding in the startup parameter Settings file, as well as specifying the encoding in the maven configuration
mvn version
F: $ mvn -version
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: D:Program Filesapache-maven-3.9.6
Java version: 17.0.9, vendor: GraalVM Community, runtime: D:Program FilesJavagraalvm-community-jdk-17.0.9
Default locale: zh_CN, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
java version
F: $ java -version
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22)
OpenJDK 64-Bit Server VM GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22, mixed mode, sharing)
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.8.3</quarkus.platform.version>
<quarkus-cxf-bom.version>3.8.3</quarkus-cxf-bom.version>
these is my boot parameters
-Dmaven.test.skip=true compile quarkus:dev -pl device-manager-robot -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Duser.language=UTF-8
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<configuration>
<systemProperties>
<file.encoding>UTF-8</file.encoding>
</systemProperties>
</configuration>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
And I’ve specified that both the file encoding and the console encoding are UTF8, and that file.encoding=UTF-8
is set in the idea64.properties
file, and I’ve changed almost every place I can think of where I can specify the encoding, but in the console output, Chinese characters are still garbled.
enter image description here
enter image description here
@GET
@Path("{id}")
public YCRobotInfo findById(Long id) {
log.info("find by id - {}", "中文");
return repository.findById(id);
}
2024-05-11 15:12:24,683 INFO 13816 --- [ executor-thread-1] com.o.r.resource.RobotInfoResource : find by id - ����
I changed everything I could think of to specify the encoding, but the console output was still garbled
Caelebs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.