mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 14:56:05 -04:00
修复 Windows 平台 GPU 信息可能显示为 "[B@xxx" 的问题 (#4288)
Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
parent
aab3b22290
commit
58c93ff349
@ -27,6 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -93,6 +94,9 @@ final class WindowsGPUDetector {
|
|||||||
return null;
|
return null;
|
||||||
} else if (object instanceof String[]) {
|
} else if (object instanceof String[]) {
|
||||||
return String.join(" ", (String[]) object);
|
return String.join(" ", (String[]) object);
|
||||||
|
} else if (object instanceof byte[]) {
|
||||||
|
return new String((byte[]) object, StandardCharsets.UTF_16LE)
|
||||||
|
.replace("\0", "");
|
||||||
} else {
|
} else {
|
||||||
return object.toString();
|
return object.toString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user