strman-java icon indicating copy to clipboard operation
strman-java copied to clipboard

gradle build command fails due to Cp1252 encoding

Open AhmadHoghooghi opened this issue 6 years ago • 0 comments

Problem

I just downloaded the "strman-java-master" zip file and navigated to its directory. gradle build command failed with this exception:

FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':javadoc'.

Something went wrong with \src\main\java\starman\Ascii.java file. "unmappable character for encoding Cp1252"

There are lots of errors like this: C:\strman-java-master\src\main\java\strman\Ascii.java:38: error: unmappable character for encoding Cp1252 put("1", Arrays.asList("┬╣", "Γé?", "█▒"));

Solution

I did some research and solved the problem by adding these lines to gradle.build. compileJava.options.encoding = 'UTF-8' compileTestJava.options.encoding = 'UTF-8' javadoc.options.encoding = 'UTF-8' Since its not reproducible in some cases, I decided to ask for opinions about adding these lines to project.

Context

This is part of gradle --version result:

Groovy: 2.4.12 Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017 JVM: 1.8.0_102 (Oracle Corporation 25.102-b14) OS: Windows 10 10.0 amd64

AhmadHoghooghi avatar Mar 04 '18 19:03 AhmadHoghooghi