2005-07-27 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / Mono.Globalization.Unicode / MSCompatUnicodeTableUtil.cs
1 using System;
2 using System.Globalization;
3 using System.Text;
4
5 namespace Mono.Globalization.Unicode
6 {
7         internal /*static*/ class MSCompatUnicodeTableUtil
8         {
9                 public const byte ResourceVersion = 3;
10
11                 public static readonly CodePointIndexer Ignorable;
12                 public static readonly CodePointIndexer Category;
13                 public static readonly CodePointIndexer Level1;
14                 public static readonly CodePointIndexer Level2;
15                 public static readonly CodePointIndexer Level3;
16 //              public static readonly CodePointIndexer WidthCompat;
17                 public static readonly CodePointIndexer CjkCHS;
18                 public static readonly CodePointIndexer Cjk;
19
20                 static MSCompatUnicodeTableUtil ()
21                 {
22                         // FIXME: those ranges could be more compact, but since
23                         // I haven't filled all the table yet, I keep it safer.
24                         int [] ignoreStarts = new int [] {
25                                 0, 0xA000, 0xF900};
26                         int [] ignoreEnds = new int [] {
27                                 0x3400, 0xA500, 0x10000};
28                         int [] catStarts = new int [] {
29                                 0, 0x1E00, 0x3000, 0x4E00, 0xAC00, 0xF900};
30                         int [] catEnds = new int [] {
31                                 0x1200, 0x2800, 0x3400, 0xA000, 0xD7B0, 0x10000};
32                         int [] lv1Starts = new int [] {
33                                 0, 0x1E00, 0x3000, 0x4E00, 0xAC00, 0xF900};
34                         int [] lv1Ends = new int [] {
35                                 0x1200, 0x2800, 0x3400, 0xA000, 0xD7B0, 0x10000};
36                         int [] lv2Starts = new int [] {0, 0x1E00, 0x3000, 0xFB00};
37                         int [] lv2Ends = new int [] {0xF00, 0x2800, 0x3400, 0x10000};
38                         int [] lv3Starts = new int [] {0, 0x1E00, 0x3000, 0xFB00};
39                         int [] lv3Ends = new int [] {0x1200, 0x2800, 0x3400, 0x10000};
40 //                      int [] widthStarts = new int [] {0, 0x2000, 0x3100, 0xFF00};
41 //                      int [] widthEnds = new int [] {0x300, 0x2200, 0x3200, 0x10000};
42                         int [] chsStarts = new int [] {
43                                 0x3100, 0x4E00, 0xE800}; // FIXME: really?
44                         int [] chsEnds = new int [] {
45                                 0x3400, 0xA000, 0x10000};
46                         int [] cjkStarts = new int [] {0x3100, 0x4E00, 0xF900};
47                         int [] cjkEnds = new int [] {0x3400, 0xA000, 0xFB00};
48
49                         Ignorable = new CodePointIndexer (ignoreStarts, ignoreEnds, -1, -1);
50                         Category = new CodePointIndexer (catStarts, catEnds, 0, 0);
51                         Level1 = new CodePointIndexer (lv1Starts, lv1Ends, 0, 0);
52                         Level2 = new CodePointIndexer (lv2Starts, lv2Ends, 0, 0);
53                         Level3 = new CodePointIndexer (lv3Starts, lv3Ends, 0, 0);
54 //                      WidthCompat = new CodePointIndexer (widthStarts, widthEnds, 0, 0);
55                         CjkCHS = new CodePointIndexer (chsStarts, chsEnds, -1, -1);
56                         Cjk = new CodePointIndexer (cjkStarts, cjkEnds, -1, -1);
57                 }
58         }
59 }