diff options
author | Ray Strode <rstrode@redhat.com> | 2008-10-01 14:35:32 +0000 |
---|---|---|
committer | Ray Strode <halfline@src.gnome.org> | 2008-10-01 14:35:32 +0000 |
commit | 6d2672423bf72d4d43a1ab21fac19bd9b153ca6d (patch) | |
tree | a3d38cc4c8bb0a629c8077a9552ed312510accb6 | |
parent | 30535cf82b5f0de5358afda3d152e506576e245f (diff) | |
download | gdm-6d2672423bf72d4d43a1ab21fac19bd9b153ca6d.tar.gz |
change codeset in locale to follow canonical form so we end up with
2008-10-01 Ray Strode <rstrode@redhat.com>
* gui/simple-greeter/gdm-languages.c
(make_codeset_canonical_for_locale),
(gdm_normalize_language_name):
change codeset in locale to follow canonical
form so we end up with ".UTF-8" instead of
".utf8" etc.
svn path=/trunk/; revision=6555
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gui/simple-greeter/gdm-languages.c | 23 |
2 files changed, 32 insertions, 0 deletions
@@ -1,5 +1,14 @@ 2008-10-01 Ray Strode <rstrode@redhat.com> + * gui/simple-greeter/gdm-languages.c + (make_codeset_canonical_for_locale), + (gdm_normalize_language_name): + change codeset in locale to follow canonical + form so we end up with ".UTF-8" instead of + ".utf8" etc. + +2008-10-01 Ray Strode <rstrode@redhat.com> + * gui/simple-greeter/gdm-language-option-widget.c: * gui/simple-greeter/gdm-recent-option-widget.[ch]: Filter out duplicates from gconf mru lists that diff --git a/gui/simple-greeter/gdm-languages.c b/gui/simple-greeter/gdm-languages.c index af5fd88e..de4bfe2d 100644 --- a/gui/simple-greeter/gdm-languages.c +++ b/gui/simple-greeter/gdm-languages.c @@ -216,6 +216,25 @@ construct_language_name (const char *language, return name; } +static void +make_codeset_canonical_for_locale (const *name, + const char **codeset) +{ + char *old_locale; + char *canonical_codeset; + + old_locale = setlocale (LC_CTYPE, name); + + if (old_locale == NULL) { + return; + } + + g_free (*codeset); + *codeset = g_strdup (nl_langinfo (CODESET)); + + setlocale (LC_CTYPE, old_locale); +} + char * gdm_normalize_language_name (const char *name) { @@ -234,6 +253,10 @@ gdm_normalize_language_name (const char *name) &territory_code, &codeset, &modifier); + if (codeset != NULL) { + make_codeset_canonical_for_locale (name, &codeset); + } + normalized_name = construct_language_name (language_code, territory_code, codeset, modifier); |