summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorShih-Yuan Lee (FourDollars) <sylee@canonical.com>2013-09-03 21:16:59 +0800
committerMartin Pitt <martinpitt@gnome.org>2013-09-04 07:19:24 +0200
commitfdc62ad245eb76c337cea2abbbeaca7ddf7c60eb (patch)
tree81a7cef67692e824f5faba7e3916d8a08ef9ec70 /tools
parent347b8b0b93b1e96bfc8a2d54df3d2864ba1d861f (diff)
downloadupower-fdc62ad245eb76c337cea2abbbeaca7ddf7c60eb.tar.gz
Set locale in daemon and tool
This is necessary to properly show non-UTF8 strings in debug mode (for the daemon) and upower --dump etc. (for the tool).
Diffstat (limited to 'tools')
-rw-r--r--tools/up-tool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/up-tool.c b/tools/up-tool.c
index c82dae4..ad4015e 100644
--- a/tools/up-tool.c
+++ b/tools/up-tool.c
@@ -30,6 +30,7 @@
#include <sys/time.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
+#include <locale.h>
#include "up-client.h"
#include "up-device.h"
@@ -281,6 +282,7 @@ main (int argc, char **argv)
#if !defined(GLIB_VERSION_2_36)
g_type_init ();
#endif
+ setlocale(LC_ALL, "");
context = g_option_context_new ("UPower tool");
g_option_context_add_main_entries (context, entries, NULL);