codebrainz commented on this pull request.
@@ -1032,4 +1032,31 @@ gchar *win32_get_user_config_dir(void)
return g_build_filename(g_get_user_config_dir(), "geany", NULL); }
+ +void win32_make_argc_and_argv_in_utf8(gint *pargc, gchar ***pargv) +{ + int num_arg; + LPWSTR *szarglist = CommandLineToArgvW(GetCommandLineW(), &num_arg); + char **utf8argv = g_new0(char *, num_arg + 1); + int i = num_arg; + while(i) + { + i--; + utf8argv[i] = g_utf16_to_utf8((gunichar2 *)szarglist[i], -1, NULL, NULL, NULL);
that Windows API is a lot more annoying to use for us
It's not _a lot_ more annoying, just `WideCharToMultiByte` with `CPUTF8`. Could even write a little function like `win32_wide_to_utf8` that hides the pre-flight pass and allocates the memory with GLib's allocator. It's maybe 5-10 lines of code to write that function.