Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Qiu Wenbo
That's ok. On 2018/10/15 21:13, Christophe Fergeau wrote: Hey, patch looks good to me, if that's ok with you, I'll change the commit log to: win32: fix command line encoding on windows platform On Windows, the arguments we get in GApplication::ocal_command_line come from g_win32

Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Christophe Fergeau
Hey, patch looks good to me, if that's ok with you, I'll change the commit log to: win32: fix command line encoding on windows platform On Windows, the arguments we get in GApplication::ocal_command_line come from g_win32_get_command_line(), and g_option_context_parse_strv() docum

Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Qiu Wenbo
Sorry, I don't read the code very carefully. You are right, since the default command line is parsed by g_option_context_parse_strv (https://gitlab.gnome.org/GNOME/glib/blob/7c1f38b1c9d97519bf087a37a7d8c0a6e6bfdf18/gio/gapplication.c#L561) we can use the same code path. I have generated a new pa

Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Christophe Fergeau
Hey, On Mon, Oct 15, 2018 at 07:26:12PM +0800, Qiu Wenbo wrote: > Thank you. We can't use the same code path here. The code path of > GApplication on Windows is different compared to Linux. To handle different > file name encodings on Windows, GApplication will get its command line > arguments thr

Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Qiu Wenbo
Thank you. We can't use the same code path here. The code path of GApplication on Windows is different compared to Linux. To handle different file name encodings on Windows, GApplication will get its command line arguments through g_win32_get_command_line() which will return an arrary of UTF-8

Re: [virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread Christophe Fergeau
Hey, For some reason, the patch did not get through so well (html maybe), blank space was missing. I'm attaching a version which should be more readable to this email. g_option_context_parse_strv documentation has more details regarding the different with g_option_context_parse, I'd add this to th

[virt-tools-list] [PATCH virt-viewer] fix character encoding on Windows platform

2018-10-15 Thread 邱文博
virt-viewer can't handle encoding of its command line arguments correctly on Windows. As a simple test case, simply run remote-viewer -t "你好" spice://:5900 on Windows and the titlebar will not display characters as we expect. From 5e52e3a2a292e9a663fc9ba6560603df5aca66b7 Mon Sep 17 00: