ges-launch: make it portable to all locales.
authorAlban Browaeys <prahal@yahoo.com>
Mon, 17 Jun 2013 05:55:54 +0000 (07:55 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Mon, 1 Jul 2013 08:02:10 +0000 (10:02 +0200)
Call setlocale (LC_ALL, "") as per setlocale man page
to make ges-launch portable to all locales (instead of default
"C" one).

Fixes g_option_context_parse on:
$ ges-launch-1.0 --verbose -r -q /home/prahal/Vidéos/Test3.xges -o
file:///home/prahal/Test3.mpeg
Error initializing: Invalid byte sequence in conversion input

The accentuated character in "Vidéos" the french xdg user directory
for "Videos" is what is choked upon.

https://bugzilla.gnome.org/show_bug.cgi?id=702425

tools/ges-launch.c

index 931a763..6b39d2a 100644 (file)
@@ -29,6 +29,8 @@
 #include <ges/ges.h>
 #include <gst/pbutils/encoding-profile.h>
 
+#include <locale.h>             /* for LC_ALL */
+
 /* GLOBAL VARIABLE */
 static guint repeat = 0;
 static GESTimelinePipeline *pipeline = NULL;
@@ -459,6 +461,8 @@ main (int argc, gchar ** argv)
   GMainLoop *mainloop;
   GstBus *bus;
 
+  setlocale (LC_ALL, "");
+
   ctx = g_option_context_new ("- plays or renders a timeline.");
   g_option_context_set_summary (ctx,
       "ges-launch renders a timeline, which can be specified on the commandline,\n"