policykit-gnome r77 - trunk/tools
- From: fcrozat svn gnome org
- To: svn-commits-list gnome org
- Subject: policykit-gnome r77 - trunk/tools
- Date: Thu, 11 Sep 2008 16:03:10 +0000 (UTC)
Author: fcrozat
Date: Thu Sep 11 16:03:10 2008
New Revision: 77
URL: http://svn.gnome.org/viewvc/policykit-gnome?rev=77&view=rev
Log:
- Handle correctly being not UTF-8 on non-UTF8 locale (GNOME bug #551698)
Modified:
trunk/tools/polkit-gnome-authorization.c
Modified: trunk/tools/polkit-gnome-authorization.c
==============================================================================
--- trunk/tools/polkit-gnome-authorization.c (original)
+++ trunk/tools/polkit-gnome-authorization.c Thu Sep 11 16:03:10 2008
@@ -365,8 +365,12 @@
for_uid = polkit_authorization_get_uid (auth);
pw = getpwuid (for_uid);
if (pw != NULL)
- if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0)
- for_user = g_strdup_printf ("%s (%s)", pw->pw_gecos, pw->pw_name);
+ if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0) {
+ char *locale_gecos;
+ locale_gecos = g_locale_to_utf8 (pw->pw_gecos, -1, NULL, NULL, NULL);
+ for_user = g_strdup_printf ("%s (%s)", locale_gecos, pw->pw_name);
+ g_free (locale_gecos);
+ }
else
for_user = g_strdup_printf ("%s", pw->pw_name);
else
@@ -661,8 +665,13 @@
continue;
/* Real name */
- if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0)
- real_name = g_strdup_printf (_("%s (%s)"), pw->pw_gecos, pw->pw_name);
+ if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0) {
+ char *locale_gecos;
+
+ locale_gecos = g_locale_to_utf8 (pw->pw_gecos, -1, NULL, NULL, NULL);
+ real_name = g_strdup_printf (_("%s (%s)"), locale_gecos, pw->pw_name);
+ g_free (locale_gecos);
+ }
else
real_name = g_strdup (pw->pw_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]