]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Correctly open URLs with non-ASCII characters on Windows.
authorArnavion <redacted>
Mon, 8 Sep 2014 00:11:14 +0000 (17:11 -0700)
committerTingPing <redacted>
Sat, 22 Nov 2014 04:24:09 +0000 (23:24 -0500)
Fixes #1023

src/fe-gtk/fe-gtk.c

index 004068afb6e4459f157836caf3238874f4425825..3c97a9046180d5e118015649ff77071e42502c8f 100644 (file)
@@ -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