GNOME Bugzilla – Bug 587949
gnome-shell doesn't handle correctly username in non-utf8 locale
Last modified: 2009-07-10 18:19:53 UTC
when running in non-UTF8 locale (for instance, fr_FR.ISO-8859-15), if username is containing non ASCII characters (for instance, Frédéric Crozat), no conversion from current locale to UTF-8 is done in gdmuser/gdm-user-manager.c, some g_locale_to_utf8 calls are missing.
Should check if this fix has already been done in gdm and if there are any other fixes that need to be merged up. (Hopefully things haven't diverged that much)
Created attachment 138007 [details] [review] Bug 587949 - Handle locale-encoded names from struct pwent Convert to utf8 internally.
Created attachment 138008 [details] [review] Merge up to commit 92e608bd0f3807314c45ee5f5daf6ba781c27d58 of gdm Pull in a few fixes from gdm trunk for gdm-user.c
Looks good. if (first_comma) { - real_name = g_strndup (pwent->pw_gecos, - (first_comma - pwent->pw_gecos)); + real_name = g_strndup (real_name_utf8, first_comma - real_name_utf8); + g_free (real_name_utf8); } else { You could avoid a malloc/free by just doing if (first_comma) *first_comma = '\0';
Well, then I'd have to strdup in the other path (which is probably the common one). Thanks for review!