Author: atsushi
Date: 2005-07-08 09:46:11 -0400 (Fri, 08 Jul 2005)
New Revision: 47100
Modified:
trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
trunk/mcs/class/corlib/Mono.Globalization.Unicode/SimpleCollator.cs
Log:
2005-07-08 Atsushi Enomoto <[EMAIL PROTECTED]>
* SimpleCollator.cs : Special weight fixes on GetSortKey(). Dash type
should be computed from ExtenderType, and voice mark weight should
be considered.
* MSCompatUnicodeTable.cs : added tiny comment.
Modified: trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-08
13:29:17 UTC (rev 47099)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/ChangeLog 2005-07-08
13:46:11 UTC (rev 47100)
@@ -1,5 +1,12 @@
2005-07-08 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * SimpleCollator.cs : Special weight fixes on GetSortKey(). Dash type
+ should be computed from ExtenderType, and voice mark weight should
+ be considered.
+ * MSCompatUnicodeTable.cs : added tiny comment.
+
+2005-07-08 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* SortKey.cs : It borked when MONO_USE_MANAGED_COLLATION is not yes.
* SimpleCollator.cs : support for extender (U+309D etc.).
Modified:
trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
2005-07-08 13:29:17 UTC (rev 47099)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/MSCompatUnicodeTable.cs
2005-07-08 13:46:11 UTC (rev 47100)
@@ -150,6 +150,8 @@
return false;
}
+ // FIXME: it should be removed at some stage
+ // (will become unused).
public static byte GetJapaneseDashType (char c)
{
switch (c) {
Modified: trunk/mcs/class/corlib/Mono.Globalization.Unicode/SimpleCollator.cs
===================================================================
--- trunk/mcs/class/corlib/Mono.Globalization.Unicode/SimpleCollator.cs
2005-07-08 13:29:17 UTC (rev 47099)
+++ trunk/mcs/class/corlib/Mono.Globalization.Unicode/SimpleCollator.cs
2005-07-08 13:46:11 UTC (rev 47100)
@@ -510,8 +510,10 @@
if (i < 0x309D || i > 0xFF70)
return ExtenderType.None;
- if (i == 0xFE7C || i == 0xFE7D || i == 0xFF70)
+ if (i == 0xFE7C || i == 0xFE7D)
return ExtenderType.Simple;
+ if (i == 0xFF70)
+ return ExtenderType.Conditional;
if (i > 0x30FE)
return ExtenderType.None;
if (i == 0x309D || i == 0x30FD)
@@ -523,6 +525,18 @@
return ExtenderType.None;
}
+ byte ToDashTypeValue (ExtenderType ext)
+ {
+ switch (ext) {
+ case ExtenderType.None:
+ return 3;
+ case ExtenderType.Conditional:
+ return 5;
+ default:
+ return 4;
+ }
+ }
+
bool IsIgnorable (int i)
{
return Uni.IsIgnorable (i) ||
@@ -546,7 +560,7 @@
b [3] != 1 ? b [3] :
level3 [lv3Indexer.ToIndex (i)]);
} else
FillSortKeyRaw (i,
- ext ==
ExtenderType.Conditional);
+ ext);
continue;
}
@@ -572,12 +586,12 @@
}
else {
previousChar = i;
- FillSortKeyRaw (i, false);
+ FillSortKeyRaw (i, ExtenderType.None);
}
}
}
- void FillSortKeyRaw (int i, bool kanaExtender)
+ void FillSortKeyRaw (int i, ExtenderType ext)
{
if (0x3400 <= i && i <= 0x4DB5) {
int diff = i - 0x3400;
@@ -604,7 +618,7 @@
if (Uni.HasSpecialWeight ((char) i)) {
byte level1 = Level1 (i);
- if (kanaExtender)
+ if (ext == ExtenderType.Conditional)
level1 = (byte) ((level1 & 0xF) % 8);
buf.AppendKana (
Category (i),
@@ -612,10 +626,13 @@
Level2 (i),
Uni.Level3 (i),
Uni.IsJapaneseSmallLetter ((char) i),
- Uni.GetJapaneseDashType ((char) i),
+ ToDashTypeValue (ext),
!Uni.IsHiragana ((char) i),
Uni.IsHalfWidthKana ((char) i)
);
+ if (ext == ExtenderType.Voiced)
+ // Append voice weight
+ buf.AppendNormal (1, 1, 1, 0);
}
else
buf.AppendNormal (
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches