Behdad Esfahbod fabca3
diff -up gdm-2.23.2/gui/simple-greeter/gdm-language-chooser-widget.c.unknown-lang gdm-2.23.2/gui/simple-greeter/gdm-language-chooser-widget.c
Behdad Esfahbod fabca3
--- gdm-2.23.2/gui/simple-greeter/gdm-language-chooser-widget.c.unknown-lang	2008-08-14 15:26:43.000000000 -0400
Behdad Esfahbod fabca3
+++ gdm-2.23.2/gui/simple-greeter/gdm-language-chooser-widget.c	2008-08-14 15:26:50.000000000 -0400
Behdad Esfahbod fabca3
@@ -133,6 +133,7 @@ gdm_language_chooser_widget_add_language
Behdad Esfahbod fabca3
 static gboolean
Behdad Esfahbod fabca3
 language_has_font (const char *locale)
Behdad Esfahbod fabca3
 {
Behdad Esfahbod fabca3
+  const FcCharSet *charset;
Behdad Esfahbod fabca3
   FcPattern   *pattern;
Behdad Esfahbod fabca3
   FcObjectSet *object_set;
Behdad Esfahbod fabca3
   FcFontSet   *font_set;
Behdad Esfahbod fabca3
@@ -146,22 +147,30 @@ language_has_font (const char *locale)
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
   gdm_parse_language_name (locale, &language_code, NULL, NULL, NULL);
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
-  pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
Behdad Esfahbod fabca3
+  charset = FcLangGetCharSet ((FcChar8 *) language_code);
Behdad Esfahbod fabca3
+  if (!charset)
Behdad Esfahbod fabca3
+    /* fontconfig does not know about this language */
Behdad Esfahbod fabca3
+    is_displayable = TRUE;
Behdad Esfahbod fabca3
+  else
Behdad Esfahbod fabca3
+    {
Behdad Esfahbod fabca3
+      /* see if any fonts support rendering it */
Behdad Esfahbod fabca3
+      pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
Behdad Esfahbod fabca3
+
Behdad Esfahbod fabca3
+      if (pattern == NULL)
Behdad Esfahbod fabca3
+	goto done;
Behdad Esfahbod fabca3
+
Behdad Esfahbod fabca3
+      object_set = FcObjectSetCreate ();
Behdad Esfahbod fabca3
+
Behdad Esfahbod fabca3
+      if (object_set == NULL)
Behdad Esfahbod fabca3
+	goto done;
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
-  if (pattern == NULL)
Behdad Esfahbod fabca3
-    goto done;
Behdad Esfahbod fabca3
+      font_set = FcFontList (NULL, pattern, object_set);
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
-  object_set = FcObjectSetBuild (NULL, NULL);
Behdad Esfahbod fabca3
+      if (font_set == NULL)
Behdad Esfahbod fabca3
+	goto done;
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
-  if (object_set == NULL)
Behdad Esfahbod fabca3
-    goto done;
Behdad Esfahbod fabca3
-
Behdad Esfahbod fabca3
-  font_set = FcFontList (NULL, pattern, object_set);
Behdad Esfahbod fabca3
-
Behdad Esfahbod fabca3
-  if (font_set == NULL)
Behdad Esfahbod fabca3
-    goto done;
Behdad Esfahbod fabca3
-
Behdad Esfahbod fabca3
-  is_displayable = (font_set->nfont > 0);
Behdad Esfahbod fabca3
+      is_displayable = (font_set->nfont > 0);
Behdad Esfahbod fabca3
+    }
Behdad Esfahbod fabca3
 
Behdad Esfahbod fabca3
 done:
Behdad Esfahbod fabca3