GApplication: change commandline encoding policy
authorRyan Lortie <desrt@desrt.ca>
Sun, 12 Jan 2014 17:31:38 +0000 (12:31 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sat, 18 Jan 2014 01:06:37 +0000 (20:06 -0500)
commite5f91951a132b4a7daa848887a87ba22f96568bc
tree2e3f1ff7a87bdf7d4fcf142dd37931cf12c84aff
parent643f2b348dea7486ef2eaa4f8e4eb858bce5f3e1
GApplication: change commandline encoding policy

Clarify in the documentation that the commandline arguments passed
around by GApplication (to local_command_line and returned via
g_application_command_line_get_arguments()) are in the GLib filename
encoding (ie: UTF-8) on Windows, not the system code page.

Fix the mismatch that would result from having argv passed to
g_application_run() in main() on Windows (where it is in the system
code page) by ignoring argc/argv on Windows and calling
g_win32_get_command_line() for ourselves.  Document this.

This might be a slight API break on Windows: we documented that it was
possible to call g_application_run() with arguments other than argc/argv
and now doing that will result in those arguments being ignored.  It has
always been recommended practice to only call g_application_run() from
main() directly, however, and all of our code examples have shown only
this.  We will see if this causes any issues and consider reevaluating
the situation if so.

https://bugzilla.gnome.org/show_bug.cgi?id=722025
gio/gapplication.c
gio/gapplicationcommandline.c