[Github-comments] [geany/geany] Provide utf-8 command line arguments on Windows (#1258)
Enrico Tröger
notifications at xxxxx
Wed Nov 9 21:31:22 UTC 2016
eht16 commented on this pull request.
> +{
+ 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);
+ }
+ *pargc = num_arg;
+ *pargv = utf8argv;
+ LocalFree(szarglist);
+}
+
+void win32_free_argv_made_in_utf8(gint argc, gchar **argv)
Absolutely, I missed the point that the array is NULL-terminated. Sorry.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1258
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20161109/40f0893b/attachment.html>
More information about the Github-comments
mailing list