[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: gtk_init_with_args behavior
From:       "Lucky B.C" <lblackc13 () gmail ! com>
Date:       2018-05-23 8:02:10
Message-ID: CAN9t-McCDK0n=aXo7qng79DDdpG3WJRBoHtD9geog4t9eOUEAw () mail ! gmail ! com
[Download RAW message or body]

You should make another version for only Windows, I think that it's better!

On Mon, May 21, 2018 at 6:21 PM, Allin Cottrell <cottrell@wfu.edu> wrote:

> On Mon, 21 May 2018, tito-wolit wrote:
>
> On 21/05/2018 01:27, Allin Cottrell wrote:
>>
>>>
>>> gtk_init_with_args is still useful in my case: it automatically screens
>>> out any command-line arguments that are just option flags or parameters,
>>> via the GOptionEntry mechanism, leaving only a filename argument to which
>>> my program has to respond (but which may be broken in plain argv).
>>> Fortunately, it works fine after conversion via g_utf16_to_utf8. So my
>>> workflow is:
>>>
>>> GetCommandLineW
>>> CommandLineToArgvW
>>> convert array of UTF-16 strings to UTF-8
>>> pass the converted array to gtk_init_with_args
>>>
>>
>> Hi,
>> I use:
>>
>> filename = g_locale_to_utf8((argv*), -1, NULL, NULL, NULL);
>> do something with filename
>> free(filename)
>>
>> This works also on windows.
>>
>
> Ah, but it does NOT work in the case I'm talking about, where the filename
> in question is not representable in the current Windows Code Page, because
> it contains a mixture of character sets. Then the only way to get the real,
> non-mangled filename from Windows is in UTF-16 form via GetCommandLineW.
>
> The problem arises only because Windows doesn't do UTF-8, and so cannot
> pass "exotic" filenames via C's argv.
>
> Allin Cottrell
>
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic