On 2024-11-12 Jeremy Drake wrote:
> On Tue, 12 Nov 2024, Martin Storsjö wrote:
> 
> > Regarding the above, I wouldn't exactly think that those apps ignore
> > argv[] and get the command line some other way - but I'm not
> > entirely sure; ideally we'd take it up with them to understand
> > exactly what their setup is and how it works, and how our change
> > broke that.
> >
> > But it'd be interesting to know how their test cases worked exactly
> > anyway.  
> 
> One comment referenced glib g_win32_get_command_line returning utf-8,
> so I assume it calls GetCommandLineW and converts to UTF-8 itself?

GetCommandLineW() is parsed with CommandLineToArgvW() and then
converted to UTF-8:

    
https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gwin32.c?ref_type=heads#L756

The comment above the function is worth reading. The intention is that
argv[] from main() is ignored.

The UTF-8 conversion returns NULL if there are unpaired surrogates.
That is, the resulting argv[] may have NULL pointers.

    
https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gutf8.c?ref_type=heads#L1077

-- 
Lasse Collin


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to