Author: atsushi
Date: 2005-07-12 09:42:54 -0400 (Tue, 12 Jul 2005)
New Revision: 47208

Modified:
   trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
   trunk/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs
Log:
2005-07-12  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * SortKeyBuffer.cs : Fixed shift level computation to match w/ Windows.



Modified: trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-12 
13:02:18 UTC (rev 47207)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-12 
13:42:54 UTC (rev 47208)
@@ -1,5 +1,9 @@
 2005-07-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * SortKeyBuffer.cs : Fixed shift level computation to match w/ Windows.
+
+2005-07-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * SimpleCollator.cs : fixed LastIndexOf() to handle _target's_ 
          contraction as expected. Fixed Compare() to save s2's contraction
          as expected.

Modified: trunk/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs  
2005-07-12 13:02:18 UTC (rev 47207)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/SortKeyBuffer.cs  
2005-07-12 13:42:54 UTC (rev 47208)
@@ -154,16 +154,16 @@
                        // If it strictly matches to Windows, offsetValue is 
always l2.
                        int offsetValue = l2 - level5LastPos;
                        // If it strictly matches ti Windows, no 0xFF here.
-                       for (; offsetValue > 8064; offsetValue -= 8064)
+                       for (; offsetValue > 8192; offsetValue -= 8192)
                                AppendBufferPrimitive (0xFF, ref l5b, ref l5);
 #else
                        // LAMESPEC: Windows cannot compute lv5 values for
                        // those string that has length larger than 8064.
                        // (It reminds me of SQL Server varchar length).
-                       int offsetValue = l2 % 8064;
+                       int offsetValue = (l2 + 1) % 8192;
 #endif
-                       AppendBufferPrimitive ((byte) ((offsetValue / 63) * 4 + 
0x80), ref l5b, ref l5);
-                       AppendBufferPrimitive ((byte) (offsetValue % 63 * 4 + 
7), ref l5b, ref l5);
+                       AppendBufferPrimitive ((byte) ((offsetValue / 64) + 
0x80), ref l5b, ref l5);
+                       AppendBufferPrimitive ((byte) (offsetValue % 64 * 4 + 
3), ref l5b, ref l5);
 
                        level5LastPos = l2;
 

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

Reply via email to