mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-12 00:14:20 +00:00
TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (#7660)
This commit is contained in:
parent
2206e31e54
commit
a18622c369
4 changed files with 11 additions and 2 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue