Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1dc700d

Browse files
committed
Merge pull request #1881 from Clockwork-Muse/1872_System.Text.Encoding.CodePages_TestExecutionOrder
Update System.Text.Encoding.CodePage tests.
2 parents baa3151 + 6bc037a commit 1dc700d

File tree

2 files changed

+578
-896
lines changed

2 files changed

+578
-896
lines changed

src/System.Text.Encoding.CodePages/src/System/Text/EncodingTable.Data.cs

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static partial class EncodingTable
1616
// Using indices from s_encodingNamesIndices, we binary search this string when mapping
1717
// an encoding name to a codepage. Note that these names are all lowercase and are
1818
// sorted alphabetically.
19-
//
19+
//
2020
private const string s_encodingNames =
2121
"437" + // 437
2222
"arabic" + // 28596
@@ -755,7 +755,7 @@ internal static partial class EncodingTable
755755
3406
756756
};
757757

758-
//
758+
//
759759
// s_codePagesByName contains the list of supported codepages which match the encoding
760760
// names listed in s_encodingNames. The way mapping works is we binary search
761761
// s_encodingNames using s_encodingNamesIndices until we find a match for a given name.
@@ -1129,7 +1129,7 @@ internal static partial class EncodingTable
11291129
950 // x-x-big5
11301130
};
11311131

1132-
//
1132+
//
11331133
// When retrieving the value for System.Text.Encoding.WebName or
11341134
// System.Text.Encoding.EncodingName given System.Text.Encoding.CodePage,
11351135
// we perform a linear search on s_mappedCodePages to find the index of the
@@ -1250,6 +1250,7 @@ internal static partial class EncodingTable
12501250
28599, // iso-8859-9
12511251
28603, // iso-8859-13
12521252
28605, // iso-8859-15
1253+
29001, // x-europa
12531254
38598, // iso-8859-8-i
12541255
50220, // iso-2022-jp
12551256
50221, // csiso2022jp
@@ -1273,7 +1274,7 @@ internal static partial class EncodingTable
12731274
57011 // x-iscii-pa
12741275
};
12751276

1276-
//
1277+
//
12771278
// s_webNames is a concatenation of the default encoding names
12781279
// for each code page. It is used in retrieving the value for
12791280
// System.Text.Encoding.WebName given System.Text.Encoding.CodePage.
@@ -1391,6 +1392,7 @@ internal static partial class EncodingTable
13911392
"iso-8859-9" + // 28599
13921393
"iso-8859-13" + // 28603
13931394
"iso-8859-15" + // 28605
1395+
"x-europa" + // 29001
13941396
"iso-8859-8-i" + // 38598
13951397
"iso-2022-jp" + // 50220
13961398
"csiso2022jp" + // 50221
@@ -1413,7 +1415,7 @@ internal static partial class EncodingTable
14131415
"x-iscii-gu" + // 57010
14141416
"x-iscii-pa"; // 57011
14151417

1416-
//
1418+
//
14171419
// s_webNameIndices contains the start index of each code page's default
14181420
// web name in the string s_webNames. It is indexed by an index into
14191421
// s_mappedCodePages.
@@ -1530,37 +1532,38 @@ internal static partial class EncodingTable
15301532
956, // iso-8859-9 (28599)
15311533
966, // iso-8859-13 (28603)
15321534
977, // iso-8859-15 (28605)
1533-
988, // iso-8859-8-i (38598)
1534-
1000, // iso-2022-jp (50220)
1535-
1011, // csiso2022jp (50221)
1536-
1022, // iso-2022-jp (50222)
1537-
1033, // iso-2022-kr (50225)
1538-
1044, // x-cp50227 (50227)
1539-
1053, // euc-jp (51932)
1540-
1059, // euc-cn (51936)
1541-
1065, // euc-kr (51949)
1542-
1071, // hz-gb-2312 (52936)
1543-
1081, // gb18030 (54936)
1544-
1088, // x-iscii-de (57002)
1545-
1098, // x-iscii-be (57003)
1546-
1108, // x-iscii-ta (57004)
1547-
1118, // x-iscii-te (57005)
1548-
1128, // x-iscii-as (57006)
1549-
1138, // x-iscii-or (57007)
1550-
1148, // x-iscii-ka (57008)
1551-
1158, // x-iscii-ma (57009)
1552-
1168, // x-iscii-gu (57010)
1553-
1178, // x-iscii-pa (57011)
1554-
1188
1535+
988, // x-europa (29001)
1536+
996, // iso-8859-8-i (38598)
1537+
1008, // iso-2022-jp (50220)
1538+
1019, // csiso2022jp (50221)
1539+
1030, // iso-2022-jp (50222)
1540+
1041, // iso-2022-kr (50225)
1541+
1052, // x-cp50227 (50227)
1542+
1061, // euc-jp (51932)
1543+
1067, // euc-cn (51936)
1544+
1073, // euc-kr (51949)
1545+
1079, // hz-gb-2312 (52936)
1546+
1089, // gb18030 (54936)
1547+
1096, // x-iscii-de (57002)
1548+
1106, // x-iscii-be (57003)
1549+
1116, // x-iscii-ta (57004)
1550+
1126, // x-iscii-te (57005)
1551+
1136, // x-iscii-as (57006)
1552+
1146, // x-iscii-or (57007)
1553+
1156, // x-iscii-ka (57008)
1554+
1166, // x-iscii-ma (57009)
1555+
1176, // x-iscii-gu (57010)
1556+
1186, // x-iscii-pa (57011)
1557+
1196
15551558
};
15561559

1557-
//
1560+
//
15581561
// s_englishNames is the concatenation of the English names for each codepage.
15591562
// It is used in retrieving the value for System.Text.Encoding.EncodingName
15601563
// given System.Text.Encoding.CodePage.
15611564
// This is done rather than using a large readonly array of strings to avoid
15621565
// generating a large amount of code in the static constructor.
1563-
//
1566+
//
15641567
private const string s_englishNames =
15651568
"IBM EBCDIC (US-Canada)" + // 37
15661569
"OEM United States" + // 437
@@ -1672,6 +1675,7 @@ internal static partial class EncodingTable
16721675
"Turkish (ISO)" + // 28599
16731676
"Estonian (ISO)" + // 28603
16741677
"Latin 9 (ISO)" + // 28605
1678+
"Europa" + // 29001
16751679
"Hebrew (ISO-Logical)" + // 38598
16761680
"Japanese (JIS)" + // 50220
16771681
"Japanese (JIS-Allow 1 byte Kana)" + // 50221
@@ -1694,7 +1698,7 @@ internal static partial class EncodingTable
16941698
"ISCII Gujarati" + // 57010
16951699
"ISCII Punjabi"; // 57011
16961700

1697-
//
1701+
//
16981702
// s_englishNameIndices contains the start index of each code page's English
16991703
// name in the string s_englishNames. It is indexed by an index into
17001704
// s_mappedCodePages.
@@ -1811,28 +1815,29 @@ internal static partial class EncodingTable
18111815
2008, // Turkish (ISO) (28599)
18121816
2021, // Estonian (ISO) (28603)
18131817
2035, // Latin 9 (ISO) (28605)
1814-
2048, // Hebrew (ISO-Logical) (38598)
1815-
2068, // Japanese (JIS) (50220)
1816-
2082, // Japanese (JIS-Allow 1 byte Kana) (50221)
1817-
2114, // Japanese (JIS-Allow 1 byte Kana - SO/SI) (50222)
1818-
2154, // Korean (ISO) (50225)
1819-
2166, // Chinese Simplified (ISO-2022) (50227)
1820-
2195, // Japanese (EUC) (51932)
1821-
2209, // Chinese Simplified (EUC) (51936)
1822-
2233, // Korean (EUC) (51949)
1823-
2245, // Chinese Simplified (HZ) (52936)
1824-
2268, // Chinese Simplified (GB18030) (54936)
1825-
2296, // ISCII Devanagari (57002)
1826-
2312, // ISCII Bengali (57003)
1827-
2325, // ISCII Tamil (57004)
1828-
2336, // ISCII Telugu (57005)
1829-
2348, // ISCII Assamese (57006)
1830-
2362, // ISCII Oriya (57007)
1831-
2373, // ISCII Kannada (57008)
1832-
2386, // ISCII Malayalam (57009)
1833-
2401, // ISCII Gujarati (57010)
1834-
2415, // ISCII Punjabi (57011)
1835-
2428
1818+
2048, // Europa (29001)
1819+
2054, // Hebrew (ISO-Logical) (38598)
1820+
2074, // Japanese (JIS) (50220)
1821+
2088, // Japanese (JIS-Allow 1 byte Kana) (50221)
1822+
2120, // Japanese (JIS-Allow 1 byte Kana - SO/SI) (50222)
1823+
2160, // Korean (ISO) (50225)
1824+
2172, // Chinese Simplified (ISO-2022) (50227)
1825+
2201, // Japanese (EUC) (51932)
1826+
2215, // Chinese Simplified (EUC) (51936)
1827+
2239, // Korean (EUC) (51949)
1828+
2251, // Chinese Simplified (HZ) (52936)
1829+
2274, // Chinese Simplified (GB18030) (54936)
1830+
2302, // ISCII Devanagari (57002)
1831+
2318, // ISCII Bengali (57003)
1832+
2331, // ISCII Tamil (57004)
1833+
2342, // ISCII Telugu (57005)
1834+
2354, // ISCII Assamese (57006)
1835+
2368, // ISCII Oriya (57007)
1836+
2379, // ISCII Kannada (57008)
1837+
2392, // ISCII Malayalam (57009)
1838+
2407, // ISCII Gujarati (57010)
1839+
2421, // ISCII Punjabi (57011)
1840+
2434
18361841
};
18371842
}
18381843
}

0 commit comments

Comments
 (0)