Commit 6d267242 authored by Ray Strode's avatar Ray Strode Committed by Ray Strode

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
parent 30535cf8
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:
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment