[gui] Fix non-ASCII filename rendering in TRootBrowser#22455
Conversation
ROOT's application manifest explicitly declares UTF-8 active code page, so strings entering the GDK backend are guaranteed to be valid UTF-8. Use explicit UTF-8 decoding instead of mbstowcs(), which would misinterpret the UTF-8 byte stream under the system's legacy ANSI code page.
Co-authored-by: ferdymercury <ferdymercury@users.noreply.github.com>
Test Results 21 files 21 suites 3d 10h 49m 18s ⏱️ Results for commit 073c555. |
|
Hi, thanks for triggering the CI! Regarding the Please let me know if you would like me to manually re-format just the newly added lines to match the project's style guide, or how we should best handle the formatting here. Thanks! |
|
@wacfrr no, don't worry about the formatting. And it looks good. I'll perform some more tests and then we'll see if it's good to go |
ROOT's application manifest explicitly declares UTF-8 active code page, so strings entering the GDK backend are guaranteed to be valid UTF-8. Use explicit UTF-8 decoding instead of mbstowcs(), which would misinterpret the UTF-8 byte stream under the system's legacy ANSI code page.
This Pull request:
Fixes non-ASCII (CJK and other) filename display in TRootBrowser on Windows.
Changes or fixes:
graf2d/win32gdk/gdk/src/gdk/win32/gdkim-win32.c: Replace mbstowcs with explicit UTF-8 decoding in gdk_nmbstowchar_ts, since ROOT's application manifest already declares UTF-8.
graf2d/win32gdk/gdk/src/gdk/win32/gdkfont-win32.c: Add font fallback to the first available font in gdk_wchar_text_handle when no exact Unicode block match is found, with defensive null checks on the font list.
Checklist:
This PR addresses #22450