mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2025-12-25 23:10:04 +01:00
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).
This commit is contained in:
parent
347b8b0b93
commit
fdc62ad245
2 changed files with 4 additions and 0 deletions
|
|
@ -32,6 +32,7 @@
|
|||
#include <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <glib-object.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
|
|
@ -207,6 +208,7 @@ main (gint argc, gchar **argv)
|
|||
#if !defined(GLIB_VERSION_2_36)
|
||||
g_type_init ();
|
||||
#endif
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
context = g_option_context_new ("upower daemon");
|
||||
g_option_context_add_main_entries (context, options, NULL);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue