JDK-8221525: jpackage fails with non-ASCII characters in --copyright JDK-8200758-branch
authorherrick
Wed, 27 Mar 2019 07:45:21 -0400
branchJDK-8200758-branch
changeset 57287 90fa9a095959
parent 57286 2ee6dedec44f
child 57288 0be43184f52a
JDK-8221525: jpackage fails with non-ASCII characters in --copyright Submitten-by: almatvee Reviewed-by: herrick
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java	Tue Mar 26 19:03:24 2019 -0400
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java	Wed Mar 27 07:45:21 2019 -0400
@@ -35,6 +35,7 @@
 import java.io.Writer;
 import java.io.BufferedWriter;
 import java.io.FileWriter;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.StandardCopyOption;
@@ -331,8 +332,9 @@
         validateValueAndPut(data, "PRODUCT_NAME", APP_NAME, params);
         validateValueAndPut(data, "PRODUCT_VERSION", VERSION, params);
 
-        try (Writer w = new BufferedWriter(
-                new FileWriter(getConfig_ExecutableProperties(params)))) {
+        try (Writer w = Files.newBufferedWriter(
+                getConfig_ExecutableProperties(params).toPath(),
+                StandardCharsets.UTF_8)) {
             String content = preprocessTextResource(
                     getConfig_ExecutableProperties(params).getName(),
                     I18N.getString("resource.executable-properties-template"),