public unsafe static void FillCJK(string culture, ref CodePointIndexer cjkIndexer, ref byte *catTable, ref byte *lv1Table, ref CodePointIndexer lv2Indexer, ref byte *lv2Table)
        {
            object obj = MSCompatUnicodeTable.forLock;

            lock (obj)
            {
                MSCompatUnicodeTable.FillCJKCore(culture, ref cjkIndexer, ref catTable, ref lv1Table, ref lv2Indexer, ref lv2Table);
                MSCompatUnicodeTable.SetCJKReferences(culture, ref cjkIndexer, ref catTable, ref lv1Table, ref lv2Indexer, ref lv2Table);
            }
        }
 public static bool IsSortable(string s)
 {
     foreach (char cp in s)
     {
         if (!MSCompatUnicodeTable.IsSortable((int)cp))
         {
             return(false);
         }
     }
     return(true);
 }
        private unsafe static void FillCJKCore(string culture, ref CodePointIndexer cjkIndexer, ref byte *catTable, ref byte *lv1Table, ref CodePointIndexer cjkLv2Indexer, ref byte *lv2Table)
        {
            if (!MSCompatUnicodeTable.IsReady)
            {
                return;
            }
            string text = null;

            switch (culture)
            {
            case "zh-CHS":
                text     = "cjkCHS";
                catTable = MSCompatUnicodeTable.cjkCHScategory;
                lv1Table = MSCompatUnicodeTable.cjkCHSlv1;
                break;

            case "zh-CHT":
                text     = "cjkCHT";
                catTable = MSCompatUnicodeTable.cjkCHTcategory;
                lv1Table = MSCompatUnicodeTable.cjkCHTlv1;
                break;

            case "ja":
                text     = "cjkJA";
                catTable = MSCompatUnicodeTable.cjkJAcategory;
                lv1Table = MSCompatUnicodeTable.cjkJAlv1;
                break;

            case "ko":
                text     = "cjkKO";
                catTable = MSCompatUnicodeTable.cjkKOcategory;
                lv1Table = MSCompatUnicodeTable.cjkKOlv1;
                break;
            }
            if (text == null || lv1Table != 0)
            {
                return;
            }
            uint   num2     = 0u;
            string name     = string.Format("collation.{0}.bin", text);
            IntPtr resource = MSCompatUnicodeTable.GetResource(name);

            if (resource == IntPtr.Zero)
            {
                return;
            }
            byte *ptr = (byte *)((void *)resource);

            num2 += 1u;
            uint num3 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num2);

            num2    += 4u;
            catTable = ptr + num2;
            lv1Table = ptr + num2 + num3;
            switch (culture)
            {
            case "zh-CHS":
                MSCompatUnicodeTable.cjkCHScategory = catTable;
                MSCompatUnicodeTable.cjkCHSlv1      = lv1Table;
                break;

            case "zh-CHT":
                MSCompatUnicodeTable.cjkCHTcategory = catTable;
                MSCompatUnicodeTable.cjkCHTlv1      = lv1Table;
                break;

            case "ja":
                MSCompatUnicodeTable.cjkJAcategory = catTable;
                MSCompatUnicodeTable.cjkJAlv1      = lv1Table;
                break;

            case "ko":
                MSCompatUnicodeTable.cjkKOcategory = catTable;
                MSCompatUnicodeTable.cjkKOlv1      = lv1Table;
                break;
            }
            if (text != "cjkKO")
            {
                return;
            }
            resource = MSCompatUnicodeTable.GetResource("collation.cjkKOlv2.bin");
            if (resource == IntPtr.Zero)
            {
                return;
            }
            ptr  = (byte *)((void *)resource);
            num2 = 5u;
            MSCompatUnicodeTable.cjkKOlv2 = ptr + num2;
            lv2Table = MSCompatUnicodeTable.cjkKOlv2;
        }
        unsafe static MSCompatUnicodeTable()
        {
            IntPtr resource = MSCompatUnicodeTable.GetResource("collation.core.bin");

            if (resource == IntPtr.Zero)
            {
                return;
            }
            byte *ptr = (byte *)((void *)resource);

            resource = MSCompatUnicodeTable.GetResource("collation.tailoring.bin");
            if (resource == IntPtr.Zero)
            {
                return;
            }
            byte *ptr2 = (byte *)((void *)resource);

            if (ptr == null || ptr2 == null)
            {
                return;
            }
            if (*ptr != 3 || *ptr2 != 3)
            {
                return;
            }
            uint num  = 1u;
            uint num2 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num);

            num += 4u;
            MSCompatUnicodeTable.ignorableFlags = ptr + num;
            num += num2;
            num2 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num);
            num += 4u;
            MSCompatUnicodeTable.categories = ptr + num;
            num += num2;
            num2 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num);
            num += 4u;
            MSCompatUnicodeTable.level1 = ptr + num;
            num += num2;
            num2 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num);
            num += 4u;
            MSCompatUnicodeTable.level2 = ptr + num;
            num += num2;
            num2 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr, num);
            num += 4u;
            MSCompatUnicodeTable.level3 = ptr + num;
            num += num2;
            num  = 1u;
            uint num3 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr2, num);

            num += 4u;
            MSCompatUnicodeTable.tailoringInfos = new TailoringInfo[num3];
            int num4 = 0;

            while ((long)num4 < (long)((ulong)num3))
            {
                int lcid = (int)MSCompatUnicodeTable.UInt32FromBytePtr(ptr2, num);
                num += 4u;
                int tailoringIndex = (int)MSCompatUnicodeTable.UInt32FromBytePtr(ptr2, num);
                num += 4u;
                int tailoringCount = (int)MSCompatUnicodeTable.UInt32FromBytePtr(ptr2, num);
                num += 4u;
                TailoringInfo tailoringInfo = new TailoringInfo(lcid, tailoringIndex, tailoringCount, ptr2[(UIntPtr)(num++)] != 0);
                MSCompatUnicodeTable.tailoringInfos[num4] = tailoringInfo;
                num4++;
            }
            num += 2u;
            num3 = MSCompatUnicodeTable.UInt32FromBytePtr(ptr2, num);
            num += 4u;
            MSCompatUnicodeTable.tailoringArr = new char[num3];
            int num5 = 0;

            while ((long)num5 < (long)((ulong)num3))
            {
                MSCompatUnicodeTable.tailoringArr[num5] = (char)((int)ptr2[num] + ((int)ptr2[num + 1u] << 8));
                num5++;
                num += 2u;
            }
            MSCompatUnicodeTable.isReady = true;
        }
 public static bool IsIgnorableNonSpacing(int cp)
 {
     return(MSCompatUnicodeTable.IsIgnorable(cp, 4));
 }
 public static bool IsIgnorableSymbol(int cp)
 {
     return(MSCompatUnicodeTable.IsIgnorable(cp, 2));
 }
 public static bool IsSortable(int cp)
 {
     return(!MSCompatUnicodeTable.IsIgnorable(cp) || cp == 0 || cp == 1600 || cp == 65279 || (6155 <= cp && cp <= 6158) || (8204 <= cp && cp <= 8207) || (8234 <= cp && cp <= 8238) || (8298 <= cp && cp <= 8303) || (8204 <= cp && cp <= 8207) || (65529 <= cp && cp <= 65533));
 }