mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-07 03:48:25 +00:00
TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (#7660)
This commit is contained in:
@@ -15090,7 +15090,11 @@ static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const cha
|
||||
#endif
|
||||
static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
||||
{
|
||||
return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32;
|
||||
const int path_wsize = ::MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
|
||||
ImVector<wchar_t> path_wbuf;
|
||||
path_wbuf.resize(path_wsize);
|
||||
::MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wbuf.Data, path_wsize);
|
||||
return (INT_PTR)::ShellExecuteW(NULL, L"open", path_wbuf.Data, NULL, NULL, SW_SHOWDEFAULT) > 32;
|
||||
}
|
||||
#else
|
||||
#include <sys/wait.h>
|
||||
|
Reference in New Issue
Block a user