From b8c28487c30aa2bc6933e9b661d1aedb8c0fea9b Mon Sep 17 00:00:00 2001 From: oOtroyOo <497790325@qq.com> Date: Mon, 15 Jul 2024 10:56:13 +0800 Subject: [PATCH] JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 --- truststore_java.go | 1 + 1 file changed, 1 insertion(+) diff --git a/truststore_java.go b/truststore_java.go index 8ad84bba..f472a2a4 100644 --- a/truststore_java.go +++ b/truststore_java.go @@ -108,6 +108,7 @@ func (m *mkcert) uninstallJava() { // execKeytool will execute a "keytool" command and if needed re-execute // the command with commandWithSudo to work around file permissions. func execKeytool(cmd *exec.Cmd) ([]byte, error) { + cmd.Env = append(cmd.Env, "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8") out, err := cmd.CombinedOutput() if err != nil && bytes.Contains(out, []byte("java.io.FileNotFoundException")) && runtime.GOOS != "windows" { origArgs := cmd.Args[1:]