2005-04-06 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 6 Apr 2005 08:46:21 +0000 (08:46 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 6 Apr 2005 08:46:21 +0000 (08:46 -0000)
* Char.cs : ToUpper()/ToLower() comparison ranges were incorrect.

* TextInfo.cs : To make new CultureInfo (127) as invariant, it should
  not compare object Equals() against InvariantCulture.

svn path=/trunk/mcs/; revision=42597

mcs/class/corlib/System.Globalization/ChangeLog
mcs/class/corlib/System.Globalization/TextInfo.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Char.cs

index ed8181c6201958ce1ee160b6cbcb1d73732df984..20f46e838e9bed4be16006d5806a69bd7317773c 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * TextInfo.cs : To make new CultureInfo (127) as invariant, it should
+         not compare object Equals() against InvariantCulture.
+
 2005-04-05  Atsushi Enomoto  <atsushi@ximian.com>
 
        * TextInfo.cs : Fixed ToTitleCase() so that
index 18d22933a5c0ac3b138c5f3c0fb9cbfdc0f669af..470a22d2786691c97d7f186bb4c4789f981ec512 100755 (executable)
@@ -216,13 +216,13 @@ namespace System.Globalization {
                // (enumerable enough).
                public virtual char ToLower (char c)
                {
-                       if (ci == CultureInfo.InvariantCulture)
+                       if (ci.LCID == 0x7F)
                                return Char.ToLowerInvariant (c);
 
                        switch ((int) c) {
                        case '\u0049': // Latin uppercase I
                                CultureInfo tmp = ci;
-                               while (tmp.Parent != tmp && tmp.Parent != CultureInfo.InvariantCulture)
+                               while (tmp.Parent != tmp && tmp.Parent.LCID != 0x7F)
                                        tmp = tmp.Parent;
                                switch (tmp.LCID) {
                                case 44: // Azeri (az)
@@ -258,13 +258,13 @@ namespace System.Globalization {
 
                public virtual char ToUpper (char c)
                {
-                       if (ci == CultureInfo.InvariantCulture)
+                       if (ci.LCID == 0x7F)
                                return Char.ToUpperInvariant (c);
 
                        switch (c) {
                        case '\u0069': // Latin lowercase i
                                CultureInfo tmp = ci;
-                               while (tmp.Parent != tmp && tmp.Parent != CultureInfo.InvariantCulture)
+                               while (tmp.Parent != tmp && tmp.Parent.LCID != 0x7F)
                                        tmp = tmp.Parent;
                                switch (tmp.LCID) {
                                case 44: // Azeri (az)
index c6400a5d57766bc302b3f617a7bb3dfbdd4014ea..b9f2e5cce54dd212e2aeb0e44dc950f7f268b5a0 100644 (file)
@@ -1,3 +1,7 @@
+2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * Char.cs : ToUpper()/ToLower() comparison ranges were incorrect.
+
 2005-04-05  Sebastien Pouliot  <sebastien@ximian.com>
 
        * _AppDomain.cs: Add security checks to the interface. Declarative 
index ff7e770ffe3d7c1aa17c02ac54f6a5418b241bea..865bd2814d41558fee06ace94c93c24958e5af65 100644 (file)
@@ -498,8 +498,8 @@ namespace System
                        unsafe {
                                if (c <= ((char)0x24cf))
                                        return (char) to_lower_data_low [c];
-                               if (c >= ((char)0xff41))
-                                       return (char) to_lower_data_high[c - 0xff41];
+                               if (c >= ((char)0xff21))
+                                       return (char) to_lower_data_high[c - 0xff21];
                        }
                        return c;
                }
@@ -522,7 +522,7 @@ namespace System
                internal static char ToUpperInvariant (char c)
                {
                        unsafe {
-                               if (c <= ((char)0x24cf))
+                               if (c <= ((char)0x24e9))
                                        return (char) to_upper_data_low [c];
                                if (c >= ((char)0xff21))
                                        return (char) to_upper_data_high [c - 0xff21];