Skip to content

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

Merged
Glavo merged 3 commits intoHMCL-dev:mainfrom
Henryxjh:main
Aug 19, 2025
Merged

修复 Windows 平台 GPU 信息可能显示为"[B@xxx" 的问题#4288
Glavo merged 3 commits intoHMCL-dev:mainfrom
Henryxjh:main

Conversation

@Henryxjh
Copy link
Copy Markdown
Contributor

#4286 修复Windows启动时注册表项目类型为REG_BINARY时输出的GPU信息不正常

} else if (object instanceof String[]) {
return String.join(" ", (String[]) object);
} else if (object instanceof byte[]) {
return new String((byte[])object);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看你给的截图,里面的字符串数据应该是 UTF-16LE 编码的,你这样实现会导致字符串里存在大量 \0

而且,请不要在任何地方使用 new String(byte[]) 这个方法,应当总是明确指定字符串的编码。

@Glavo Glavo changed the title 修复注册表保存类型为REG_BINARY时输出的GPU信息为"[B@xxx" 修复 Windows 平台 GPU 信息可能显示为"[B@xxx" 的问题 Aug 19, 2025
@Glavo Glavo merged commit 58c93ff into HMCL-dev:main Aug 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants