From ad2300f2365e4499fb559c80a6c313d82e8c36d6 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sun, 7 Sep 2014 17:11:14 -0700 Subject: [PATCH] Correctly open URLs with non-ASCII characters on Windows. Fixes #1023 --- src/fe-gtk/fe-gtk.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index 004068af..3c97a904 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -1042,7 +1042,16 @@ static void fe_open_url_inner (const char *url) { #ifdef WIN32 - ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL); + gunichar2 *url_utf16 = g_utf8_to_utf16 (url, -1, NULL, NULL, NULL); + + if (url_utf16 == NULL) + { + return; + } + + ShellExecuteW (0, L"open", url_utf16, NULL, NULL, SW_SHOWNORMAL); + + g_free (url_utf16); #elif defined(__APPLE__) osx_show_uri (url); #else