--- gtk+-1.2.10/gtk/gtkrc.iso88593.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88593	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-3" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-3,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-3,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-3"
+
--- gtk+-1.2.10/gtk/Makefile.am.encoding	Fri Feb  2 12:09:02 2001
+++ gtk+-1.2.10/gtk/Makefile.am	Fri Jul 26 16:47:04 2002
@@ -374,10 +374,12 @@
 
 
 gtkconfdir = $(sysconfdir)/gtk
-gtkconf_DATA = gtkrc.az gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
-	gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk gtkrc.iso-8859-2 \
-	gtkrc.iso-8859-5 gtkrc.iso-8859-13 gtkrc.iso-8859-14 \
-	gtkrc.iso-8859-15 gtkrc.zh_CN gtkrc.zh_TW.big5 \
+gtkconf_DATA = gtkrc.az gtkrc.he gtkrc.hy gtkrc.ja \
+	gtkrc.ko gtkrc.ru gtkrc.th gtkrc.uk \
+	gtkrc.utf8 gtkrc.iso88592 \
+	gtkrc.iso88593 gtkrc.iso88595 gtkrc.iso88597 \
+	gtkrc.iso88599 gtkrc.iso885913 gtkrc.iso885914 \
+	gtkrc.iso885915 gtkrc.zh_CN gtkrc.zh_TW.big5 \
 	gtkrc.ka_GE.georgianacademy gtkrc.ka_GE.georgianps \
 	gtkrc.vi_VN.tcvn gtkrc.vi_VN.viscii gtkrc.cp1251 gtkrc.cp1255
 
@@ -390,11 +392,11 @@
 	cd $(DESTDIR)$(gtkconfdir) && \
 	  for i in cs hr hu pl ro sk sl sq sr ; do \
 	    rm -f gtkrc.$$i ; \
-	    ln -s gtkrc.iso-8859-2 gtkrc.$$i ; \
+	    ln -s gtkrc.iso88592 gtkrc.$$i ; \
 	  done ; \
 	  for i in bg_BG.iso88595 mk sp ru_RU.iso88595 ; do \
 	    rm -f gtkrc.$$i ; \
-	    ln -s gtkrc.iso-8859-5 gtkrc.$$i ; \
+	    ln -s gtkrc.iso88595 gtkrc.$$i ; \
 	  done ; \
 	  for i in he_IL.cp1255 he_IL.microsoftcp1255 yi ; do \
 	    rm -f gtkrc.$$i ; \
@@ -403,12 +405,12 @@
 	rm -f gtkrc.lt gtkrc.lv gtkrc.cy gtkrc.ga gtkrc.et gtkrc.ka \
 	     gtkrc.vi_VN.viscii111 gtkrc.vi_VN.tcvn5712 gtkrc.vi \
 	     gtkrc.be gtkrc.bg gtkrc.mi ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.mi ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.lt ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.lv ; \
-	ln -s gtkrc.iso-8859-14 gtkrc.cy ; \
-	ln -s gtkrc.iso-8859-14 gtkrc.ga ; \
-	ln -s gtkrc.iso-8859-15 gtkrc.et ; \
+	ln -s gtkrc.iso885913 gtkrc.mi ; \
+	ln -s gtkrc.iso885913 gtkrc.lt ; \
+	ln -s gtkrc.iso885913 gtkrc.lv ; \
+	ln -s gtkrc.iso885914 gtkrc.cy ; \
+	ln -s gtkrc.iso885914 gtkrc.ga ; \
+	ln -s gtkrc.iso885915 gtkrc.et ; \
 	ln -s gtkrc.ka_GE.georgianps gtkrc.ka ; \
 	ln -s gtkrc.vi_VN.viscii gtkrc.vi_VN.viscii111 ; \
 	ln -s gtkrc.vi_VN.tcvn gtkrc.vi ; \
--- gtk+-1.2.10/gtk/gtkrc.c.encoding	Thu Mar 15 13:41:40 2001
+++ gtk+-1.2.10/gtk/gtkrc.c	Fri Jul 26 16:49:24 2002
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <langinfo.h>
 
 #include "gtkrc.h"
 #include "gtkbindings.h"
@@ -440,7 +441,7 @@
 void
 gtk_rc_init (void)
 {
-  static gchar *locale_suffixes[3];
+  static gchar *locale_suffixes[8];
   static gint n_locale_suffixes = 0;
 
   gint i, j;
@@ -449,9 +450,7 @@
 
   if (!initted)
     {
-      gint length;
-      
-      char *locale = setlocale (LC_CTYPE, NULL);
+      char *locale = g_strdup (setlocale (LC_CTYPE, NULL));
       char *p;
       
       initted = TRUE;
@@ -470,39 +469,88 @@
 	   * We normalize the charset into a standard form,
 	   * which has all '-' and '_' characters removed,
 	   * and is lowercase.
+	   *
+	   * the search is done in that order:
+	   * gtkrc.ll_cc.lowercasecodeset
+	   * gtkrc.ll_cc.normalizedcodeset
+	   * gtkrc.ll.lowercasecodeset
+	   * gtkrc.ll.normalizedcodeset
+	   * gtkrc.lowercasecodeset
+	   * gtkrc.normalizedcodeset
+	   * gtkrc.ll_cc
+	   * gtkrc.ll
+	   * 
 	   */
-	  gchar *normalized_locale;
+	  char *codeset = NULL;
+	  char *normalized_codeset = NULL;
+	  char *cc = NULL;
+	  char *ll;
 
 	  p = strchr (locale, '@');
-	  length = p ? (p -locale) : strlen (locale);
+	  if (p)
+	    *p = '\0';
 
+	  codeset = nl_langinfo (CODESET);
+	  
 	  p = strchr (locale, '.');
+	  if (!codeset && p)
+	    codeset = p + 1;
 	  if (p)
+	    *p = '\0';
+	  
+	  if (codeset)
 	    {
-	      gchar *tmp1 = g_strndup (locale, p - locale + 1);
-	      gchar *tmp2 = _gtk_normalize_codeset (p + 1, length - (p - locale + 1));
+	      codeset = g_strdup (codeset);
 	      
-	      normalized_locale = g_strconcat (tmp1, tmp2, NULL);
-	      g_free (tmp1);
-	      g_free (tmp2);
-						 
-	      locale_suffixes[n_locale_suffixes++] = g_strdup (normalized_locale);
-	      length = p - locale;
+	      p = codeset;
+	      while (*p)
+		{
+		  /* tolower not used, because some locales are not
+		   * compatible with C locale in lowercasing ascii
+		   */
+		  if (*p >= 'A' && *p <= 'Z')
+		    *p = (*p) - 'A' + 'a';
+		  p++;
+		}
+	      
+	      normalized_codeset = _gtk_normalize_codeset(codeset, strlen (codeset));
+	      if (strcmp (normalized_codeset, codeset) == 0)
+		{
+		  g_free (normalized_codeset);
+		  normalized_codeset = NULL;
+		}
 	    }
-	  else
-	    normalized_locale = g_strndup (locale, length);
 	  
-	  p = strchr (normalized_locale, '_');
+	  p = strchr (locale, '_');
 	  if (p)
 	    {
-	      locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
-	      length = p - normalized_locale;
+	      cc = p + 1;
+	      *p = '\0';
 	    }
-	  
-	  locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
 
-	  g_free (normalized_locale);
+	  ll = locale;	
+	
+	  if (cc && codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, ".", codeset, NULL);
+          if (cc && normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, ".", normalized_codeset, NULL);
+	  if (codeset)
+            locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, ".", codeset, NULL);
+          if (normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, ".", normalized_codeset, NULL);
+	  if (codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strdup (codeset);
+	  if (normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strdup (normalized_codeset);
+	  if (cc)
+            locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, NULL);
+	  locale_suffixes[n_locale_suffixes++] = g_strdup (ll);
+
+	  g_free (normalized_codeset);
+	  g_free (codeset);
 	}
+
+      g_free (locale);
     }
   
   i = 0;
--- gtk+-1.2.10/gtk/gtkrc.iso88599.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88599	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-9" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-9,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-9,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-9"
+
--- gtk+-1.2.10/gtk/gtkrc.utf8.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.utf8	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,7 @@
+style "default-text" {
+       fontset = "-*-helvetica-medium-r-normal--*-120-*-*-p-*-*-*"
+
+}
+
+class "GtkWidget" style "default-text"
+
--- gtk+-1.2.10/gtk/gtkrc.iso885913.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885913	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,7 @@
+style "gtk-default-iso-8859-13" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-13,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-13,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-13"
--- gtk+-1.2.10/gtk/gtkrc.iso885914.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885914	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-14" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-14,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-14,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-14"
+
--- gtk+-1.2.10/gtk/gtkrc.iso885915.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885915	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-15" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-15,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-15,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-15"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88592.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88592	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,14 @@
+#$(gtkconfigdir)/gtkrc.iso-8859-2
+#
+# This file defines the fontsets for iso-8859-2 encoding
+# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-2
+# and a gtkrc.$LANG doesn't exist yet.
+
+style  "gtk-default-iso-8859-2" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-2,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-2,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-2"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88595.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88595	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,14 @@
+#$(gtkconfigdir)/gtkrc.iso-8859-5
+#
+# This file defines the fontsets for iso-8859-5 encoding
+# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-5
+# and a gtkrc.$LANG doesn't exist yet.
+
+style "gtk-default-iso-8859-5" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-5,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-5,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-5"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88597.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88597	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-7" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-7,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-7,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-7"
+
