[Libreoffice-commits] core.git: odk/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Dec 5 15:06:48 UTC 2020


 odk/source/com/sun/star/lib/loader/WinRegKey.java |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ffb1a9f3d570a4769d901709658b4e6bb2db5db2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Dec 5 14:54:44 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Dec 5 16:06:15 2020 +0100

    Silence cid#1470402 FB.DM_DEFAULT_ENCODING
    
    ...where the default encoding should be the appropriate one for reading the
    Runtime.exec output
    
    Change-Id: Ib64bfcbcca985f2de506f8628b506e6dc7bfc035
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107255
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/odk/source/com/sun/star/lib/loader/WinRegKey.java b/odk/source/com/sun/star/lib/loader/WinRegKey.java
index bdbcced68afa..3276458fc6f6 100644
--- a/odk/source/com/sun/star/lib/loader/WinRegKey.java
+++ b/odk/source/com/sun/star/lib/loader/WinRegKey.java
@@ -21,6 +21,7 @@ package com.sun.star.lib.loader;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
+import java.nio.charset.Charset;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -45,7 +46,8 @@ final class WinRegKey {
     public String getStringValue() throws WinRegKeyException {
         try {
             Process p = Runtime.getRuntime().exec(new String[]{"reg", "QUERY", m_keyName});
-            BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            BufferedReader r = new BufferedReader(
+                new InputStreamReader(p.getInputStream(), Charset.defaultCharset()));
             String v = null;
             Pattern pt = Pattern.compile("\\s+\\(Default\\)\\s+REG_SZ\\s+(.+)");
             for (;;) {


More information about the Libreoffice-commits mailing list