修复 Windows 平台 GPU 信息可能显示为 "[B@xxx" 的问题 (#4288)

Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
Henryxjh 2025-08-19 21:33:10 +08:00 committed by GitHub
parent aab3b22290
commit 58c93ff349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,7 @@ import org.jetbrains.annotations.Nullable;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.regex.Pattern;
@ -93,6 +94,9 @@ final class WindowsGPUDetector {
return null;
} else if (object instanceof String[]) {
return String.join(" ", (String[]) object);
} else if (object instanceof byte[]) {
return new String((byte[]) object, StandardCharsets.UTF_16LE)
.replace("\0", "");
} else {
return object.toString();
}