Author: atsushi
Date: 2006-01-20 03:58:54 -0500 (Fri, 20 Jan 2006)
New Revision: 55826

Modified:
   trunk/mcs/class/I18N/CJK/ChangeLog
   trunk/mcs/class/I18N/CJK/GB18030Encoding.cs
   trunk/mcs/class/I18N/CJK/Test/ChangeLog
   trunk/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs
Log:
2006-01-20  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * GB18030.cs : GetChars() ditto. Fixed bug #77306.

        * I18N.CJK.Test.cs : Added test for #77306.



Modified: trunk/mcs/class/I18N/CJK/ChangeLog
===================================================================
--- trunk/mcs/class/I18N/CJK/ChangeLog  2006-01-20 08:51:53 UTC (rev 55825)
+++ trunk/mcs/class/I18N/CJK/ChangeLog  2006-01-20 08:58:54 UTC (rev 55826)
@@ -1,5 +1,9 @@
 2006-01-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * GB18030.cs : GetChars() ditto. Fixed bug #77306.
+
+2006-01-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * CP949.cs : GetChars() exactly the same fix as CP950.
          Fixed bug #77298.
 

Modified: trunk/mcs/class/I18N/CJK/GB18030Encoding.cs
===================================================================
--- trunk/mcs/class/I18N/CJK/GB18030Encoding.cs 2006-01-20 08:51:53 UTC (rev 
55825)
+++ trunk/mcs/class/I18N/CJK/GB18030Encoding.cs 2006-01-20 08:58:54 UTC (rev 
55826)
@@ -230,7 +230,8 @@
                                } else {
                                        byte first = bytes [byteIndex];
                                        int ord = ((first - 0x81) * 191 + 
second - 0x40) * 2;
-                                       char c1 = (char) (gb2312.n2u [ord] + 
gb2312.n2u [ord + 1] * 256);
+                                       char c1 = ord < 0 || ord >= 
gb2312.n2u.Length ?
+                                               '\0' : (char) (gb2312.n2u [ord] 
+ gb2312.n2u [ord + 1] * 256);
                                        if (c1 == 0)
                                                chars [charIndex++] = '?';
                                        else

Modified: trunk/mcs/class/I18N/CJK/Test/ChangeLog
===================================================================
--- trunk/mcs/class/I18N/CJK/Test/ChangeLog     2006-01-20 08:51:53 UTC (rev 
55825)
+++ trunk/mcs/class/I18N/CJK/Test/ChangeLog     2006-01-20 08:58:54 UTC (rev 
55826)
@@ -1,5 +1,9 @@
 2006-01-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * I18N.CJK.Test.cs : Added test for #77306.
+
+2006-01-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * I18N.CJK.Test.cs : fixed broken method extraction. Added test for
          #77298.
 

Modified: trunk/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs
===================================================================
--- trunk/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs      2006-01-20 08:51:53 UTC 
(rev 55825)
+++ trunk/mcs/class/I18N/CJK/Test/I18N.CJK.Test.cs      2006-01-20 08:58:54 UTC 
(rev 55826)
@@ -234,6 +234,12 @@
                }
 
                [Test]
+               public void Bug77306 ()
+               {
+                       GetCharsAllBytePairs (54936);
+               }
+
+               [Test]
                public void Bug77298 ()
                {
                        GetCharsAllBytePairs (949);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to