1 #pragma once
2 
3 #include <glib.h>
4 
5 // On Windows the command line arguments are ANSI encoded. We want UTF-8 in dt though.
6 // including this file will add a wrapper that acts together with linker switch -municode
7 
8 int main(int argc, char *argv[]);
9 
wmain(int argc,wchar_t * argv[])10 int wmain(int argc, wchar_t *argv[])
11 {
12   char **_argv = g_malloc0((argc + 1) * sizeof(char *));
13   for(int i = 0; i < argc; i++)
14     _argv[i] = g_utf16_to_utf8(argv[i], -1, NULL, NULL, NULL);
15   int res = main(argc, _argv);
16   g_strfreev(_argv);
17   return res;
18 }
19