Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.19.1
-
None
-
None
-
Windows 10, 64-bit
DejaVu Sans font
Description
I'm having problems getting Surefire to output UTF-8 fonts under Windows.
When I run a unit test that outputs a Guava Range ("10‥20") the TWO DOT LEADER unicode character always gets rendered as a question mark.
If I run the exact same code outside of Surefire (using a main() entry point) the UTF-8 character renders just fine. The repro steps are quite simple:
- Create a Maven project.
- Run
System.out.println(Range.closed(10, 30));
in a Java class with a main() entry point, and from a JUnit test.
- The main() entry point will output UTF-8 just fine. The JUnit test will output a question mark in place of the unicode.
Here is my pom.xml file:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany</groupId> <artifactId>mavenproject1</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <argLine>-Dfile.encoding=UTF-8</argLine> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.4.0</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>foo.Main</mainClass> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>19.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> </project>
I tried the same thing using TestNG tests and noticed that although output to console was still wrong, the outputted testng-results.xml file contained the correct character.
Can you reproduce this on your end?
Attachments
Attachments
Issue Links
- is related to
-
SUREFIRE-1137 Problem with Umlauts in stdout
- Closed
-
SUREFIRE-1222 ForkClient attempts to consume unrelated lines
- Closed