Re: gtk_init_with_args behavior



Hi Allin,

on Windows, it is advisable to use an API to get the command line parameters as UTF-16,  so you don't lose the letters "foreign" to your code page.

See "CommandLineToArgvW" for more info:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx

Regards,

  Miroslav

On 5/19/2018 12:06 AM, Allin Cottrell wrote:
I'm building an application using gtk-2.24.32 for use on MS Windows, and have run into a problem which may be associated with my call to
gtk_init_with_args().

I wonder whether, besides handling the arguments detailed in the
(GOptionEntry *) argument to this function, gtk "translates" in some way the remaining program arguments? If so, this can be problematic.

Here's the case in point: a Greek Windows user, running Windows in Engish, has named a Desktop subdirectory "test" in Greek (that is, tau-epsilon-sigma-tau). In the Windows file manager he selects a file in this subdirectory that's associated via the registry with my program and double-clicks on it. What my program actually gets as a residual argument, after calling gtk_init_with_args(), is the full path to this file, but with the Greek-letter sequence replaced by "test" -- and therefore, of course, the file cannot be opened.

I'm not sure if it's Windows itself that is making this substitution or gtk. I'd be grateful if anyone could shed any light on the matter.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]