Index: glib/gunidecomp.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gunidecomp.c,v
retrieving revision 1.16
diff -u -r1.16 gunidecomp.c
--- glib/gunidecomp.c	4 Jun 2003 20:53:55 -0000	1.16
+++ glib/gunidecomp.c	8 Jun 2003 02:45:25 -0000
@@ -36,6 +36,12 @@
 #define COMBINING_CLASS(Char) \
      (((Char) > (G_UNICODE_LAST_CHAR)) ? 0 : CC((Char) >> 8, (Char) & 0xff))
 
+gint
+_g_unichar_combining_class (gunichar uc)
+{
+  return COMBINING_CLASS (uc);
+}
+
 /**
  * g_unicode_canonical_ordering:
  * @string: a UCS-4 encoded string.
Index: glib/guniprop.c
===================================================================
RCS file: /cvs/gnome/glib/glib/guniprop.c,v
retrieving revision 1.23
diff -u -r1.23 guniprop.c
--- glib/guniprop.c	23 May 2003 20:42:35 -0000	1.23
+++ glib/guniprop.c	8 Jun 2003 02:45:25 -0000
@@ -55,6 +55,8 @@
 		      (Type) == G_UNICODE_ENCLOSING_MARK)
 		      
 
+extern gint _g_unichar_combining_class (gunichar uc);
+
 /**
  * g_unichar_isalnum:
  * @c: a Unicode character
@@ -734,6 +736,28 @@
   return result;
 }
 
+/* traverses the string checking for characters with combining class == 230
+ * until a base character is found */
+static gboolean
+has_more_above (gchar *str)
+{
+  gchar *p = str;
+  gint combining_class;
+
+  while (*p)
+    {
+      combining_class = _g_unichar_combining_class (g_utf8_get_char (p));
+      if (combining_class == 230)
+        return TRUE;
+      else if (combining_class == 0)
+        break;
+
+      p = g_utf8_next_char (p);
+    }
+
+  return FALSE;
+}
+
 static gsize
 real_tolower (const gchar *str,
 	      gssize       max_len,
@@ -755,9 +779,46 @@
 
       if (locale_type == LOCALE_TURKIC && c == 'I')
 	{
-	  /* I => LATIN SMALL LETTER DOTLESS I */
-	  len += g_unichar_to_utf8 (0x131, out_buffer ? out_buffer + len : NULL); 
-	}
+          if (g_utf8_get_char (p) == 0x0307)
+            {
+              /* I + COMBINING DOT ABOVE => i (U+0069) */
+              len += g_unichar_to_utf8 (0x0069, out_buffer ? out_buffer + len : NULL); 
+              p = g_utf8_next_char (p);
+            }
+          else
+            {
+              /* I => LATIN SMALL LETTER DOTLESS I */
+              len += g_unichar_to_utf8 (0x131, out_buffer ? out_buffer + len : NULL); 
+            }
+	}
+      /* Introduce an explicit dot above when lowercasing capital I's and J's
+       * whenever there are more accents above. [SpecialCasing.txt] */
+      else if (locale_type == LOCALE_LITHUANIAN 
+               && (c == 0x00cc || c == 0x00cd || c == 0x0128))
+        {
+          len += g_unichar_to_utf8 (0x0069, out_buffer ? out_buffer + len : NULL); 
+          len += g_unichar_to_utf8 (0x0307, out_buffer ? out_buffer + len : NULL); 
+
+          switch (c)
+            {
+            case 0x00cc: 
+              len += g_unichar_to_utf8 (0x0300, out_buffer ? out_buffer + len : NULL); 
+              break;
+            case 0x00cd: 
+              len += g_unichar_to_utf8 (0x0301, out_buffer ? out_buffer + len : NULL); 
+              break;
+            case 0x0128: 
+              len += g_unichar_to_utf8 (0x0303, out_buffer ? out_buffer + len : NULL); 
+              break;
+            }
+        }
+      else if (locale_type == LOCALE_LITHUANIAN 
+               && (c == 'I' || c == 'J' || c == 0x012e)
+               && has_more_above (p))
+        {
+          len += g_unichar_to_utf8 (g_unichar_tolower (c), out_buffer ? out_buffer + len : NULL); 
+          len += g_unichar_to_utf8 (0x0307, out_buffer ? out_buffer + len : NULL); 
+        }
       else if (c == 0x03A3)	/* GREEK CAPITAL LETTER SIGMA */
 	{
 	  if ((max_len < 0 || p < str + max_len) && *p)
Index: tests/casemap.txt
===================================================================
RCS file: /cvs/gnome/glib/tests/casemap.txt,v
retrieving revision 1.1
diff -u -r1.1 casemap.txt
--- tests/casemap.txt	2 Jul 2001 00:49:21 -0000	1.1
+++ tests/casemap.txt	8 Jun 2003 02:45:25 -0000
@@ -3,8 +3,9 @@
 #
 # Some special hand crafted tests
 #
-tr_TR	i	i	İ	İ	# i => LATIN CAPITAL LETTER I WITH DOT ABOVE
-tr_TR	I	ı	I	I	# I => LATIN SMALL LETTER DOTLESS I
+tr_TR.UTF-8	i	i	İ	İ	# i => LATIN CAPITAL LETTER I WITH DOT ABOVE
+tr_TR.UTF-8	I	ı	I	I	# I => LATIN SMALL LETTER DOTLESS I
+tr_TR.UTF-8	İ	i	İ	İ	# I => LATIN SMALL LETTER DOTLESS I
 # Test reordering of YPOGEGRAMMENI across other accents
 	ᾁ	ᾁ	ᾉ	ἉΙ	
 	ᾁ	ᾁ	ᾉ	ἉΙ	
@@ -14,8 +15,19 @@
 	ΣΙΓΜΑ	σιγμα	Σιγμα	ΣΙΓΜΑ	
 # Lithuanian rule of i followed by letter with dot. Not at all sure
 # about the titlecase part here
-lt_LT	iė	iė	Ie	IE	
-lt_LT	iė	iė	Ie	IE	
+lt_LT.UTF-8	iė	iė	Ie	IE	
+lt_LT.UTF-8	iė	iė	Ie	IE	
+#
+# Lithuanian rule of I or J with accents above
+lt_LT.UTF-8	Ì	i̇̀	Ì	Ì	 # LATIN CAPITAL LETTER I WITH GRAVE
+lt_LT.UTF-8	Í	i̇́	Í	Í	 # LATIN CAPITAL LETTER I WITH ACUTE
+lt_LT.UTF-8	Ĩ	i̇̃	Ĩ	Ĩ	 # LATIN CAPITAL LETTER I WITH TILDE
+lt_LT.UTF-8	Í	i̇́	Í	Í	 # LATIN CAPITAL LETTER I (with acute accent)
+lt_LT.UTF-8	Ì	i̇̀	Ì	Ì	 # LATIN CAPITAL LETTER I (with grave accent)
+lt_LT.UTF-8	Ĩ	i̇̃	Ĩ	Ĩ	 # LATIN CAPITAL LETTER I (with tilde above)
+lt_LT.UTF-8	Į́	į̇́	Į́	Į́	 # LATIN CAPITAL LETTER I (with ogonek and acute accent)
+lt_LT.UTF-8	J́	j̇́	J́	J́	 # LATIN CAPITAL LETTER J (with acute accent)
+lt_LT.UTF-8	Į́	į̇́	Į́	Į́	 # LATIN CAPITAL LETTER I WITH OGONEK (with acute accent)
 #
 # Now the automatic tests
 #
Index: tests/gen-casemap-txt.pl
===================================================================
RCS file: /cvs/gnome/glib/tests/gen-casemap-txt.pl,v
retrieving revision 1.1
diff -u -r1.1 gen-casemap-txt.pl
--- tests/gen-casemap-txt.pl	2 Jul 2001 00:49:21 -0000	1.1
+++ tests/gen-casemap-txt.pl	8 Jun 2003 02:45:25 -0000
@@ -23,6 +23,7 @@
 # I consider the output of this program to be unrestricted.  Use it as
 # you will.
 
+require 5.006;
 use utf8;
 
 if (@ARGV != 3) {
@@ -60,6 +61,8 @@
 my @title;
 my @lower;
 
+binmode STDOUT, ":utf8";
+
 open (INPUT, "< $ARGV[1]") || exit 1;
 
 $last_code = -1;
@@ -148,6 +151,7 @@
 #
 tr_TR\ti\ti\t\x{0130}\t\x{0130}\t# i => LATIN CAPITAL LETTER I WITH DOT ABOVE
 tr_TR\tI\t\x{0131}\tI\tI\t# I => LATIN SMALL LETTER DOTLESS I
+tr_TR\tI\x{0307}\ti\tI\x{0307}\tI\x{0307}\t# I => LATIN SMALL LETTER DOTLESS I
 # Test reordering of YPOGEGRAMMENI across other accents
 \t\x{03b1}\x{0345}\x{0314}\t\x{03b1}\x{0345}\x{314}\t\x{0391}\x{0345}\x{0314}\t\x{0391}\x{0314}\x{0399}\t
 \t\x{03b1}\x{0314}\x{0345}\t\x{03b1}\x{314}\x{0345}\t\x{0391}\x{0314}\x{0345}\t\x{0391}\x{0314}\x{0399}\t
@@ -159,6 +163,17 @@
 # about the titlecase part here
 lt_LT\ti\x{117}\ti\x{117}\tIe\tIE\t
 lt_LT\tie\x{307}\tie\x{307}\tIe\tIE\t
+#
+# Lithuanian rule of I or J with accents above
+lt_LT\t\x{00cc}\ti\x{0307}\x{0300}\t\x{00cc}\t\x{00cc}\t # LATIN CAPITAL LETTER I WITH GRAVE
+lt_LT\t\x{00CD}\ti\x{0307}\x{0301}\t\x{00CD}\t\x{00CD}\t # LATIN CAPITAL LETTER I WITH ACUTE
+lt_LT\t\x{0128}\ti\x{0307}\x{0303}\t\x{0128}\t\x{0128}\t # LATIN CAPITAL LETTER I WITH TILDE
+lt_LT\tI\x{0301}\ti\x{0307}\x{0301}\tI\x{0301}\tI\x{0301}\t # LATIN CAPITAL LETTER I (with acute accent)
+lt_LT\tI\x{0300}\ti\x{0307}\x{0300}\tI\x{0300}\tI\x{0300}\t # LATIN CAPITAL LETTER I (with grave accent)
+lt_LT\tI\x{0303}\ti\x{0307}\x{0303}\tI\x{0303}\tI\x{0303}\t # LATIN CAPITAL LETTER I (with tilde above)
+lt_LT\tI\x{0328}\x{0301}\ti\x{0307}\x{0328}\x{0301}\tI\x{0328}\x{0301}\tI\x{0328}\x{0301}\t # LATIN CAPITAL LETTER I (with ogonek and acute accent)
+lt_LT\tJ\x{0301}\tj\x{0307}\x{0301}\tJ\x{0301}\tJ\x{0301}\t # LATIN CAPITAL LETTER J (with acute accent)
+lt_LT\t\x{012e}\x{0301}\t\x{012f}\x{0307}\x{0301}\t\x{012e}\x{0301}\t\x{012e}\x{0301}\t # LATIN CAPITAL LETTER I WITH OGONEK (with acute accent)
 #
 # Now the automatic tests
 #
