Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ISCIIEncoding.cs
Go to the documentation of this file.
2
3namespace System.Text;
4
5internal sealed class ISCIIEncoding : EncodingNLS, ISerializable
6{
7 internal sealed class ISCIIEncoder : System.Text.EncoderNLS
8 {
9 internal int defaultCodePage;
10
11 internal int currentCodePage;
12
13 internal bool bLastVirama;
14
15 internal override bool HasState
16 {
17 get
18 {
19 if (charLeftOver == '\0')
20 {
22 }
23 return true;
24 }
25 }
26
27 public ISCIIEncoder(EncodingNLS encoding)
28 : base(encoding)
29 {
31 }
32
33 public override void Reset()
34 {
35 bLastVirama = false;
36 charLeftOver = '\0';
37 if (m_fallbackBuffer != null)
38 {
40 }
41 }
42 }
43
44 internal sealed class ISCIIDecoder : System.Text.DecoderNLS
45 {
46 internal int currentCodePage;
47
48 internal bool bLastATR;
49
50 internal bool bLastVirama;
51
53
54 internal char cLastCharForNextNukta;
55
57
58 internal override bool HasState
59 {
60 get
61 {
63 {
65 }
66 return true;
67 }
68 }
69
70 public ISCIIDecoder(EncodingNLS encoding)
71 : base(encoding)
72 {
74 }
75
76 public override void Reset()
77 {
78 bLastATR = false;
79 bLastVirama = false;
83 if (m_fallbackBuffer != null)
84 {
86 }
87 }
88 }
89
90 private readonly int _defaultCodePage;
91
92 private static readonly int[] s_UnicodeToIndicChar = new int[1135]
93 {
94 673, 674, 675, 0, 676, 677, 678, 679, 680, 681,
95 682, 4774, 686, 683, 684, 685, 690, 687, 688, 689,
96 691, 692, 693, 694, 695, 696, 697, 698, 699, 700,
97 701, 702, 703, 704, 705, 706, 707, 708, 709, 710,
98 711, 712, 713, 714, 715, 716, 717, 719, 720, 721,
99 722, 723, 724, 725, 726, 727, 728, 0, 0, 745,
100 4842, 730, 731, 732, 733, 734, 735, 4831, 739, 736,
101 737, 738, 743, 740, 741, 742, 744, 0, 0, 4769,
102 0, 8944, 0, 0, 0, 0, 0, 4787, 4788, 4789,
103 4794, 4799, 4800, 4809, 718, 4778, 4775, 4827, 4828, 746,
104 0, 753, 754, 755, 756, 757, 758, 759, 760, 761,
105 762, 13040, 0, 0, 0, 0, 0, 0, 0, 0,
106 0, 0, 0, 0, 0, 0, 0, 0, 929, 930,
107 931, 0, 932, 933, 934, 935, 936, 937, 938, 5030,
108 0, 0, 939, 941, 0, 0, 943, 945, 947, 948,
109 949, 950, 951, 952, 953, 954, 955, 956, 957, 958,
110 959, 960, 961, 962, 963, 964, 965, 966, 0, 968,
111 969, 970, 971, 972, 973, 975, 0, 977, 0, 0,
112 0, 981, 982, 983, 984, 0, 0, 1001, 0, 986,
113 987, 988, 989, 990, 991, 5087, 0, 0, 992, 994,
114 0, 0, 996, 998, 1000, 0, 0, 0, 0, 0,
115 0, 0, 0, 0, 0, 0, 0, 0, 0, 5055,
116 5056, 0, 974, 5034, 5031, 5083, 5084, 0, 0, 1009,
117 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 0,
118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
119 0, 0, 0, 0, 0, 0, 0, 2978, 0, 0,
120 2980, 2981, 2982, 2983, 2984, 2985, 0, 0, 0, 0,
121 2987, 2989, 0, 0, 2992, 2993, 2995, 2996, 2997, 2998,
122 2999, 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008,
123 3009, 3010, 3011, 3012, 3013, 3014, 0, 3016, 3017, 3018,
124 3019, 3020, 3021, 3023, 0, 3025, 3026, 0, 3028, 3029,
125 0, 3031, 3032, 0, 0, 3049, 0, 3034, 3035, 3036,
126 3037, 3038, 0, 0, 0, 0, 3040, 3042, 0, 0,
127 3044, 3046, 3048, 0, 0, 0, 0, 0, 0, 0,
128 0, 0, 0, 0, 7092, 7093, 7098, 7104, 0, 7113,
129 0, 0, 0, 0, 0, 0, 0, 3057, 3058, 3059,
130 3060, 3061, 3062, 3063, 3064, 3065, 3066, 0, 0, 0,
131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
132 0, 0, 0, 0, 2721, 2722, 2723, 0, 2724, 2725,
133 2726, 2727, 2728, 2729, 2730, 0, 2734, 0, 2731, 2733,
134 2738, 0, 2736, 2737, 2739, 2740, 2741, 2742, 2743, 2744,
135 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754,
136 2755, 2756, 2757, 2758, 0, 2760, 2761, 2762, 2763, 2764,
137 2765, 2767, 0, 2769, 2770, 0, 2772, 2773, 2774, 2775,
138 2776, 0, 0, 2793, 6890, 2778, 2779, 2780, 2781, 2782,
139 2783, 6879, 2787, 0, 2784, 2786, 2791, 0, 2788, 2790,
140 2792, 0, 0, 6817, 0, 0, 0, 0, 0, 0,
141 0, 0, 0, 0, 0, 0, 0, 0, 0, 6826,
142 0, 0, 0, 0, 0, 2801, 2802, 2803, 2804, 2805,
143 2806, 2807, 2808, 2809, 2810, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
145 0, 0, 1953, 1954, 1955, 0, 1956, 1957, 1958, 1959,
146 1960, 1961, 1962, 6054, 0, 0, 1963, 1965, 0, 0,
147 1968, 1969, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978,
148 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988,
149 1989, 1990, 0, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
150 0, 2001, 2002, 0, 0, 2005, 2006, 2007, 2008, 0,
151 0, 2025, 6122, 2010, 2011, 2012, 2013, 2014, 2015, 0,
152 0, 0, 2016, 2018, 0, 0, 2020, 2022, 2024, 0,
153 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 6079, 6080, 0, 1998, 6058, 6055, 0,
155 0, 0, 0, 2033, 2034, 2035, 2036, 2037, 2038, 2039,
156 2040, 2041, 2042, 0, 0, 0, 0, 0, 0, 0,
157 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
158 0, 1186, 1187, 0, 1188, 1189, 1190, 1191, 1192, 1193,
159 0, 0, 0, 0, 1195, 1197, 0, 1199, 1200, 1201,
160 1203, 0, 0, 0, 1207, 1208, 0, 1210, 0, 1212,
161 1213, 0, 0, 0, 1217, 1218, 0, 0, 0, 1222,
162 1223, 1224, 0, 0, 0, 1228, 1229, 1231, 1232, 1233,
163 1234, 1235, 1236, 0, 1237, 1239, 1240, 0, 0, 0,
164 0, 1242, 1243, 1244, 1245, 1246, 0, 0, 0, 1248,
165 1249, 1250, 0, 1252, 1253, 1254, 1256, 0, 0, 0,
166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
168 0, 0, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273,
169 1274, 0, 0, 0, 0, 0, 0, 0, 0, 0,
170 0, 0, 0, 0, 0, 0, 0, 0, 1441, 1442,
171 1443, 0, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 5542,
172 0, 1451, 1452, 1453, 0, 1455, 1456, 1457, 1459, 1460,
173 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470,
174 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 0, 1480,
175 1481, 1482, 1483, 1484, 1485, 1487, 1488, 1489, 1490, 0,
176 1492, 1493, 1494, 1495, 1496, 0, 0, 0, 0, 1498,
177 1499, 1500, 1501, 1502, 1503, 5599, 0, 1504, 1505, 1506,
178 0, 1508, 1509, 1510, 1512, 0, 0, 0, 0, 0,
179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
180 0, 0, 0, 5546, 5543, 0, 0, 0, 0, 1521,
181 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 0,
182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
183 0, 0, 0, 0, 0, 0, 0, 2210, 2211, 0,
184 2212, 2213, 2214, 2215, 2216, 2217, 2218, 6310, 0, 2219,
185 2220, 2221, 0, 2223, 2224, 2225, 2227, 2228, 2229, 2230,
186 2231, 2232, 2233, 2234, 2235, 2236, 2237, 2238, 2239, 2240,
187 2241, 2242, 2243, 2244, 2245, 2246, 0, 2248, 2249, 2250,
188 2251, 2252, 2253, 2255, 2256, 2257, 2258, 0, 2260, 2261,
189 2262, 2263, 2264, 0, 0, 0, 0, 2266, 2267, 2268,
190 2269, 2270, 2271, 6367, 0, 2272, 2273, 2274, 0, 2276,
191 2277, 2278, 2280, 0, 0, 0, 0, 0, 0, 0,
192 0, 0, 0, 0, 0, 0, 0, 0, 0, 6345,
193 0, 6314, 6311, 0, 0, 0, 0, 2289, 2290, 2291,
194 2292, 2293, 2294, 2295, 2296, 2297, 2298, 0, 0, 0,
195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
196 0, 0, 0, 0, 0, 2466, 2467, 0, 2468, 2469,
197 2470, 2471, 2472, 2473, 2474, 6566, 0, 2475, 2476, 2477,
198 0, 2479, 2480, 2481, 2483, 2484, 2485, 2486, 2487, 2488,
199 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2497, 2498,
200 2499, 2500, 2501, 2502, 0, 2504, 2505, 2506, 2507, 2508,
201 2509, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519,
202 2520, 0, 0, 0, 0, 2522, 2523, 2524, 2525, 2526,
203 2527, 0, 0, 2528, 2529, 2530, 0, 2532, 2533, 2534,
204 2536, 0, 0, 0, 0, 0, 0, 0, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 6570,
206 6567, 0, 0, 0, 0, 2545, 2546, 2547, 2548, 2549,
207 2550, 2551, 2552, 2553, 2554
208 };
209
210 private static readonly byte[] s_SecondIndicByte = new byte[4] { 0, 233, 184, 191 };
211
212 private static readonly int[] s_IndicMappingIndex = new int[12]
213 {
214 -1, -1, 0, 1, 2, 3, 1, 4, 5, 6,
215 7, 8
216 };
217
218 private static readonly char[,,] s_IndicMapping = new char[9, 2, 96]
219 {
220 {
221 {
222 '\0', '\u0901', '\u0902', '\u0903', 'अ', 'आ', 'इ', 'ई', 'उ', 'ऊ',
223 'ऋ', 'ऎ', 'ए', 'ऐ', 'ऍ', 'ऒ', 'ओ', 'औ', 'ऑ', 'क',
224 'ख', 'ग', 'घ', 'ङ', 'च', 'छ', 'ज', 'झ', 'ञ', 'ट',
225 'ठ', 'ड', 'ढ', 'ण', 'त', 'थ', 'द', 'ध', 'न', 'ऩ',
226 'प', 'फ', 'ब', 'भ', 'म', 'य', 'य़', 'र', 'ऱ', 'ल',
227 'ळ', 'ऴ', 'व', 'श', 'ष', 'स', 'ह', '\0', '\u093e', '\u093f',
228 '\u0940', '\u0941', '\u0942', '\u0943', '\u0946', '\u0947', '\u0948', '\u0945', '\u094a', '\u094b',
229 '\u094c', '\u0949', '\u094d', '\u093c', '।', '\0', '\0', '\0', '\0', '\0',
230 '\0', '०', '१', '२', '३', '४', '५', '६', '७', '८',
231 '९', '\0', '\0', '\0', '\0', '\0'
232 },
233 {
234 '\0', 'ॐ', '\0', '\0', '\0', '\0', 'ऌ', 'ॡ', '\0', '\0',
235 'ॠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', 'क़',
236 'ख़', 'ग़', '\0', '\0', '\0', '\0', 'ज़', '\0', '\0', '\0',
237 '\0', 'ड़', 'ढ़', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
238 '\0', 'फ़', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
239 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\u0962',
240 '\u0963', '\0', '\0', '\u0944', '\0', '\0', '\0', '\0', '\0', '\0',
241 '\0', '\0', '\u200c', '\u200d', 'ऽ', '\0', '\0', '\0', '\0', '\0',
242 '뢿', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
243 '\0', '\0', '\0', '\0', '\0', '\0'
244 }
245 },
246 {
247 {
248 '\0', '\u0981', '\u0982', '\u0983', 'অ', 'আ', 'ই', 'ঈ', 'উ', 'ঊ',
249 'ঋ', 'এ', 'এ', 'ঐ', 'ঐ', 'ও', 'ও', 'ঔ', 'ঔ', 'ক',
250 'খ', 'গ', 'ঘ', 'ঙ', 'চ', 'ছ', 'জ', 'ঝ', 'ঞ', 'ট',
251 'ঠ', 'ড', 'ঢ', 'ণ', 'ত', 'থ', 'দ', 'ধ', 'ন', 'ন',
252 'প', 'ফ', 'ব', 'ভ', 'ম', 'য', 'য়', 'র', 'র', 'ল',
253 'ল', 'ল', 'ব', 'শ', 'ষ', 'স', 'হ', '\0', '\u09be', '\u09bf',
254 '\u09c0', '\u09c1', '\u09c2', '\u09c3', '\u09c7', '\u09c7', '\u09c8', '\u09c8', '\u09cb', '\u09cb',
255 '\u09cc', '\u09cc', '\u09cd', '\u09bc', '.', '\0', '\0', '\0', '\0', '\0',
256 '\0', '০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮',
257 '৯', '\0', '\0', '\0', '\0', '\0'
258 },
259 {
260 '\0', '\0', '\0', '\0', '\0', '\0', 'ঌ', 'ৡ', '\0', '\0',
261 'ৠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
262 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
263 '\0', 'ড়', 'ঢ়', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
264 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
265 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\u09e2',
266 '\u09e3', '\0', '\0', '\u09c4', '\0', '\0', '\0', '\0', '\0', '\0',
267 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
268 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
269 '\0', '\0', '\0', '\0', '\0', '\0'
270 }
271 },
272 {
273 {
274 '\0', '\0', '\u0b82', 'ஃ', 'அ', 'ஆ', 'இ', 'ஈ', 'உ', 'ஊ',
275 '\0', 'ஏ', 'ஏ', 'ஐ', 'ஐ', 'ஒ', 'ஓ', 'ஔ', 'ஔ', 'க',
276 'க', 'க', 'க', 'ங', 'ச', 'ச', 'ஜ', 'ஜ', 'ஞ', 'ட',
277 'ட', 'ட', 'ட', 'ண', 'த', 'த', 'த', 'த', 'ந', 'ன',
278 'ப', 'ப', 'ப', 'ப', 'ம', 'ய', 'ய', 'ர', 'ற', 'ல',
279 'ள', 'ழ', 'வ', 'ஷ', 'ஷ', 'ஸ', 'ஹ', '\0', '\u0bbe', '\u0bbf',
280 '\u0bc0', '\u0bc1', '\u0bc2', '\0', '\u0bc6', '\u0bc7', '\u0bc8', '\u0bc8', '\u0bca', '\u0bcb',
281 '\u0bcc', '\u0bcc', '\u0bcd', '\0', '.', '\0', '\0', '\0', '\0', '\0',
282 '\0', '0', '௧', '௨', '௩', '௪', '௫', '௬', '௭', '௮',
283 '௯', '\0', '\0', '\0', '\0', '\0'
284 },
285 {
286 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
287 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
288 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
289 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
290 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
291 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
292 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
293 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
294 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
295 '\0', '\0', '\0', '\0', '\0', '\0'
296 }
297 },
298 {
299 {
300 '\0', '\u0c01', '\u0c02', '\u0c03', 'అ', 'ఆ', 'ఇ', 'ఈ', 'ఉ', 'ఊ',
301 'ఋ', 'ఎ', 'ఏ', 'ఐ', 'ఐ', 'ఒ', 'ఓ', 'ఔ', 'ఔ', 'క',
302 'ఖ', 'గ', 'ఘ', 'ఙ', 'చ', 'ఛ', 'జ', 'ఝ', 'ఞ', 'ట',
303 'ఠ', 'డ', 'ఢ', 'ణ', 'త', 'థ', 'ద', 'ధ', 'న', 'న',
304 'ప', 'ఫ', 'బ', 'భ', 'మ', 'య', 'య', 'ర', 'ఱ', 'ల',
305 'ళ', 'ళ', 'వ', 'శ', 'ష', 'స', 'హ', '\0', '\u0c3e', '\u0c3f',
306 '\u0c40', '\u0c41', '\u0c42', '\u0c43', '\u0c46', '\u0c47', '\u0c48', '\u0c48', '\u0c4a', '\u0c4b',
307 '\u0c4c', '\u0c4c', '\u0c4d', '\0', '.', '\0', '\0', '\0', '\0', '\0',
308 '\0', '౦', '౧', '౨', '౩', '౪', '౫', '౬', '౭', '౮',
309 '౯', '\0', '\0', '\0', '\0', '\0'
310 },
311 {
312 '\0', '\0', '\0', '\0', '\0', '\0', 'ఌ', 'ౡ', '\0', '\0',
313 'ౠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
314 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
315 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
316 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
317 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
318 '\0', '\0', '\0', '\u0c44', '\0', '\0', '\0', '\0', '\0', '\0',
319 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
320 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
321 '\0', '\0', '\0', '\0', '\0', '\0'
322 }
323 },
324 {
325 {
326 '\0', '\u0b01', '\u0b02', '\u0b03', 'ଅ', 'ଆ', 'ଇ', 'ଈ', 'ଉ', 'ଊ',
327 'ଋ', 'ଏ', 'ଏ', 'ଐ', 'ଐ', 'ଐ', 'ଓ', 'ଔ', 'ଔ', 'କ',
328 'ଖ', 'ଗ', 'ଘ', 'ଙ', 'ଚ', 'ଛ', 'ଜ', 'ଝ', 'ଞ', 'ଟ',
329 'ଠ', 'ଡ', 'ଢ', 'ଣ', 'ତ', 'ଥ', 'ଦ', 'ଧ', 'ନ', 'ନ',
330 'ପ', 'ଫ', 'ବ', 'ଭ', 'ମ', 'ଯ', 'ୟ', 'ର', 'ର', 'ଲ',
331 'ଳ', 'ଳ', 'ବ', 'ଶ', 'ଷ', 'ସ', 'ହ', '\0', '\u0b3e', '\u0b3f',
332 '\u0b40', '\u0b41', '\u0b42', '\u0b43', '\u0b47', '\u0b47', '\u0b48', '\u0b48', '\u0b4b', '\u0b4b',
333 '\u0b4c', '\u0b4c', '\u0b4d', '\u0b3c', '.', '\0', '\0', '\0', '\0', '\0',
334 '\0', '୦', '୧', '୨', '୩', '୪', '୫', '୬', '୭', '୮',
335 '୯', '\0', '\0', '\0', '\0', '\0'
336 },
337 {
338 '\0', '\0', '\0', '\0', '\0', '\0', 'ఌ', 'ౡ', '\0', '\0',
339 'ౠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
340 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
341 '\0', 'ଡ଼', 'ଢ଼', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
342 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
343 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
344 '\0', '\0', '\0', '\u0c44', '\0', '\0', '\0', '\0', '\0', '\0',
345 '\0', '\0', '\u200c', '\u200d', 'ଽ', '\0', '\0', '\0', '\0', '\0',
346 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
347 '\0', '\0', '\0', '\0', '\0', '\0'
348 }
349 },
350 {
351 {
352 '\0', '\0', '\u0c82', '\u0c83', 'ಅ', 'ಆ', 'ಇ', 'ಈ', 'ಉ', 'ಊ',
353 'ಋ', 'ಎ', 'ಏ', 'ಐ', 'ಐ', 'ಒ', 'ಓ', 'ಔ', 'ಔ', 'ಕ',
354 'ಖ', 'ಗ', 'ಘ', 'ಙ', 'ಚ', 'ಛ', 'ಜ', 'ಝ', 'ಞ', 'ಟ',
355 'ಠ', 'ಡ', 'ಢ', 'ಣ', 'ತ', 'ಥ', 'ದ', 'ಧ', 'ನ', 'ನ',
356 'ಪ', 'ಫ', 'ಬ', 'ಭ', 'ಮ', 'ಯ', 'ಯ', 'ರ', 'ಱ', 'ಲ',
357 'ಳ', 'ಳ', 'ವ', 'ಶ', 'ಷ', 'ಸ', 'ಹ', '\0', '\u0cbe', '\u0cbf',
358 '\u0cc0', '\u0cc1', '\u0cc2', '\u0cc3', '\u0cc6', '\u0cc7', '\u0cc8', '\u0cc8', '\u0cca', '\u0ccb',
359 '\u0ccc', '\u0ccc', '\u0ccd', '\0', '.', '\0', '\0', '\0', '\0', '\0',
360 '\0', '೦', '೧', '೨', '೩', '೪', '೫', '೬', '೭', '೮',
361 '೯', '\0', '\0', '\0', '\0', '\0'
362 },
363 {
364 '\0', '\0', '\0', '\0', '\0', '\0', 'ಌ', 'ೡ', '\0', '\0',
365 'ೠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
366 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
367 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
368 '\0', 'ೞ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
369 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
370 '\0', '\0', '\0', '\u0cc4', '\0', '\0', '\0', '\0', '\0', '\0',
371 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
372 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
373 '\0', '\0', '\0', '\0', '\0', '\0'
374 }
375 },
376 {
377 {
378 '\0', '\0', '\u0d02', '\u0d03', 'അ', 'ആ', 'ഇ', 'ഈ', 'ഉ', 'ഊ',
379 'ഋ', 'എ', 'ഏ', 'ഐ', 'ഐ', 'ഒ', 'ഓ', 'ഔ', 'ഔ', 'ക',
380 'ഖ', 'ഗ', 'ഘ', 'ങ', 'ച', 'ഛ', 'ജ', 'ഝ', 'ഞ', 'ട',
381 'ഠ', 'ഡ', 'ഢ', 'ണ', 'ത', 'ഥ', 'ദ', 'ധ', 'ന', 'ന',
382 'പ', 'ഫ', 'ബ', 'ഭ', 'മ', 'യ', 'യ', 'ര', 'റ', 'ല',
383 'ള', 'ഴ', 'വ', 'ശ', 'ഷ', 'സ', 'ഹ', '\0', '\u0d3e', '\u0d3f',
384 '\u0d40', '\u0d41', '\u0d42', '\u0d43', '\u0d46', '\u0d47', '\u0d48', '\u0d48', '\u0d4a', '\u0d4b',
385 '\u0d4c', '\u0d4c', '\u0d4d', '\0', '.', '\0', '\0', '\0', '\0', '\0',
386 '\0', '൦', '൧', '൨', '൩', '൪', '൫', '൬', '൭', '൮',
387 '൯', '\0', '\0', '\0', '\0', '\0'
388 },
389 {
390 '\0', '\0', '\0', '\0', '\0', '\0', 'ഌ', 'ൡ', '\0', '\0',
391 'ൠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
392 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
393 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
394 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
395 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
396 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
397 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
398 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
399 '\0', '\0', '\0', '\0', '\0', '\0'
400 }
401 },
402 {
403 {
404 '\0', '\u0a81', '\u0a82', '\u0a83', 'અ', 'આ', 'ઇ', 'ઈ', 'ઉ', 'ઊ',
405 'ઋ', 'એ', 'એ', 'ઐ', 'ઍ', 'ઍ', 'ઓ', 'ઔ', 'ઑ', 'ક',
406 'ખ', 'ગ', 'ઘ', 'ઙ', 'ચ', 'છ', 'જ', 'ઝ', 'ઞ', 'ટ',
407 'ઠ', 'ડ', 'ઢ', 'ણ', 'ત', 'થ', 'દ', 'ધ', 'ન', 'ન',
408 'પ', 'ફ', 'બ', 'ભ', 'મ', 'ય', 'ય', 'ર', 'ર', 'લ',
409 'ળ', 'ળ', 'વ', 'શ', 'ષ', 'સ', 'હ', '\0', '\u0abe', '\u0abf',
410 '\u0ac0', '\u0ac1', '\u0ac2', '\u0ac3', '\u0ac7', '\u0ac7', '\u0ac8', '\u0ac5', '\u0acb', '\u0acb',
411 '\u0acc', '\u0ac9', '\u0acd', '\u0abc', '.', '\0', '\0', '\0', '\0', '\0',
412 '\0', '૦', '૧', '૨', '૩', '૪', '૫', '૬', '૭', '૮',
413 '૯', '\0', '\0', '\0', '\0', '\0'
414 },
415 {
416 '\0', 'ૐ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
417 'ૠ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
418 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
419 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
420 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
421 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
422 '\0', '\0', '\0', '\u0ac4', '\0', '\0', '\0', '\0', '\0', '\0',
423 '\0', '\0', '\u200c', '\u200d', 'ઽ', '\0', '\0', '\0', '\0', '\0',
424 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
425 '\0', '\0', '\0', '\0', '\0', '\0'
426 }
427 },
428 {
429 {
430 '\0', '\0', '\u0a02', '\0', 'ਅ', 'ਆ', 'ਇ', 'ਈ', 'ਉ', 'ਊ',
431 '\0', 'ਏ', 'ਏ', 'ਐ', 'ਐ', 'ਐ', 'ਓ', 'ਔ', 'ਔ', 'ਕ',
432 'ਖ', 'ਗ', 'ਘ', 'ਙ', 'ਚ', 'ਛ', 'ਜ', 'ਝ', 'ਞ', 'ਟ',
433 'ਠ', 'ਡ', 'ਢ', 'ਣ', 'ਤ', 'ਥ', 'ਦ', 'ਧ', 'ਨ', 'ਨ',
434 'ਪ', 'ਫ', 'ਬ', 'ਭ', 'ਮ', 'ਯ', 'ਯ', 'ਰ', 'ਰ', 'ਲ',
435 'ਲ਼', 'ਲ਼', 'ਵ', 'ਸ਼', 'ਸ਼', 'ਸ', 'ਹ', '\0', '\u0a3e', '\u0a3f',
436 '\u0a40', '\u0a41', '\u0a42', '\0', '\u0a47', '\u0a47', '\u0a48', '\u0a48', '\u0a4b', '\u0a4b',
437 '\u0a4c', '\u0a4c', '\u0a4d', '\u0a3c', '.', '\0', '\0', '\0', '\0', '\0',
438 '\0', '੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮',
439 '੯', '\0', '\0', '\0', '\0', '\0'
440 },
441 {
442 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
443 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
444 'ਖ਼', 'ਗ਼', '\0', '\0', '\0', '\0', 'ਜ਼', '\0', '\0', '\0',
445 '\0', '\0', 'ੜ', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
446 '\0', 'ਫ਼', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
447 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
448 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
449 '\0', '\0', '\u200c', '\u200d', '\0', '\0', '\0', '\0', '\0', '\0',
450 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
451 '\0', '\0', '\0', '\0', '\0', '\0'
452 }
453 }
454 };
455
465
470
471 public override int GetMaxByteCount(int charCount)
472 {
473 if (charCount < 0)
474 {
476 }
477 long num = (long)charCount + 1L;
478 if (base.EncoderFallback.MaxCharCount > 1)
479 {
480 num *= base.EncoderFallback.MaxCharCount;
481 }
482 num *= 4;
483 if (num > int.MaxValue)
484 {
486 }
487 return (int)num;
488 }
489
490 public override int GetMaxCharCount(int byteCount)
491 {
492 if (byteCount < 0)
493 {
495 }
496 long num = (long)byteCount + 1L;
497 if (base.DecoderFallback.MaxCharCount > 1)
498 {
499 num *= base.DecoderFallback.MaxCharCount;
500 }
501 if (num > int.MaxValue)
502 {
504 }
505 return (int)num;
506 }
507
508 public unsafe override int GetByteCount(char* chars, int count, System.Text.EncoderNLS baseEncoder)
509 {
510 return GetBytes(chars, count, null, 0, baseEncoder);
511 }
512
513 public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, System.Text.EncoderNLS baseEncoder)
514 {
517 int num = _defaultCodePage;
518 bool flag = false;
519 if (iSCIIEncoder != null)
520 {
521 num = iSCIIEncoder.currentCodePage;
522 flag = iSCIIEncoder.bLastVirama;
523 if (iSCIIEncoder.charLeftOver > '\0')
524 {
525 encodingByteBuffer.Fallback(iSCIIEncoder.charLeftOver);
526 flag = false;
527 }
528 }
529 while (encodingByteBuffer.MoreData)
530 {
531 char nextChar = encodingByteBuffer.GetNextChar();
532 if (nextChar < '\u00a0')
533 {
534 if (!encodingByteBuffer.AddByte((byte)nextChar))
535 {
536 break;
537 }
538 flag = false;
539 continue;
540 }
541 if (nextChar < '\u0901' || nextChar > '൯')
542 {
543 if (flag && (nextChar == '\u200c' || nextChar == '\u200d'))
544 {
545 if (nextChar == '\u200c')
546 {
547 if (!encodingByteBuffer.AddByte(232))
548 {
549 break;
550 }
551 }
552 else if (!encodingByteBuffer.AddByte(233))
553 {
554 break;
555 }
556 flag = false;
557 }
558 else
559 {
561 flag = false;
562 }
563 continue;
564 }
565 int num2 = s_UnicodeToIndicChar[nextChar - 2305];
566 byte b = (byte)num2;
567 int num3 = 0xF & (num2 >> 8);
568 int num4 = 0xF000 & num2;
569 if (num2 == 0)
570 {
572 flag = false;
573 continue;
574 }
575 if (num3 != num)
576 {
577 if (!encodingByteBuffer.AddByte(239, (byte)((uint)num3 | 0x40u)))
578 {
579 break;
580 }
581 num = num3;
582 }
583 if (!encodingByteBuffer.AddByte(b, (num4 != 0) ? 1 : 0))
584 {
585 break;
586 }
587 flag = b == 232;
588 if (num4 != 0 && !encodingByteBuffer.AddByte(s_SecondIndicByte[num4 >> 12]))
589 {
590 break;
591 }
592 }
593 if (num != _defaultCodePage && (iSCIIEncoder == null || iSCIIEncoder.MustFlush))
594 {
595 if (encodingByteBuffer.AddByte(239, (byte)((uint)_defaultCodePage | 0x40u)))
596 {
597 num = _defaultCodePage;
598 }
599 else
600 {
601 encodingByteBuffer.GetNextChar();
602 }
603 flag = false;
604 }
605 if (iSCIIEncoder != null && bytes != null)
606 {
607 if (!encodingByteBuffer.fallbackBufferHelper.bUsedEncoder)
608 {
610 }
614 }
615 return encodingByteBuffer.Count;
616 }
617
618 public unsafe override int GetCharCount(byte* bytes, int count, System.Text.DecoderNLS baseDecoder)
619 {
620 return GetChars(bytes, count, null, 0, baseDecoder);
621 }
622
623 public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount, System.Text.DecoderNLS baseDecoder)
624 {
627 int num = _defaultCodePage;
628 bool flag = false;
629 bool flag2 = false;
630 bool flag3 = false;
631 char c = '\0';
632 char c2 = '\0';
633 if (iSCIIDecoder != null)
634 {
635 num = iSCIIDecoder.currentCodePage;
636 flag = iSCIIDecoder.bLastATR;
637 flag2 = iSCIIDecoder.bLastVirama;
638 flag3 = iSCIIDecoder.bLastDevenagariStressAbbr;
639 c = iSCIIDecoder.cLastCharForNextNukta;
640 c2 = iSCIIDecoder.cLastCharForNoNextNukta;
641 }
642 bool flag4 = flag2 || flag || flag3 || c != '\0';
643 int num2 = -1;
644 if (num >= 2 && num <= 11)
645 {
647 }
648 while (encodingCharBuffer.MoreData)
649 {
650 byte nextByte = encodingCharBuffer.GetNextByte();
651 if (flag4)
652 {
653 flag4 = false;
654 if (flag)
655 {
656 if (nextByte >= 66 && nextByte <= 75)
657 {
658 num = nextByte & 0xF;
660 flag = false;
661 continue;
662 }
663 if (nextByte == 64)
664 {
665 num = _defaultCodePage;
666 num2 = -1;
667 if (num >= 2 && num <= 11)
668 {
670 }
671 flag = false;
672 continue;
673 }
674 if (nextByte == 65)
675 {
676 num = _defaultCodePage;
677 num2 = -1;
678 if (num >= 2 && num <= 11)
679 {
681 }
682 flag = false;
683 continue;
684 }
685 if (!encodingCharBuffer.Fallback(239))
686 {
687 break;
688 }
689 flag = false;
690 }
691 else if (flag2)
692 {
693 if (nextByte == 232)
694 {
695 if (!encodingCharBuffer.AddChar('\u200c'))
696 {
697 break;
698 }
699 flag2 = false;
700 continue;
701 }
702 if (nextByte == 233)
703 {
704 if (!encodingCharBuffer.AddChar('\u200d'))
705 {
706 break;
707 }
708 flag2 = false;
709 continue;
710 }
711 flag2 = false;
712 }
713 else if (flag3)
714 {
715 if (nextByte == 184)
716 {
717 if (!encodingCharBuffer.AddChar('\u0952'))
718 {
719 break;
720 }
721 flag3 = false;
722 continue;
723 }
724 if (nextByte == 191)
725 {
726 if (!encodingCharBuffer.AddChar('॰'))
727 {
728 break;
729 }
730 flag3 = false;
731 continue;
732 }
733 if (!encodingCharBuffer.Fallback(240))
734 {
735 break;
736 }
737 flag3 = false;
738 }
739 else
740 {
741 if (nextByte == 233)
742 {
743 if (!encodingCharBuffer.AddChar(c))
744 {
745 break;
746 }
747 c = (c2 = '\0');
748 continue;
749 }
750 if (!encodingCharBuffer.AddChar(c2))
751 {
752 break;
753 }
754 c = (c2 = '\0');
755 }
756 }
757 if (nextByte < 160)
758 {
759 if (!encodingCharBuffer.AddChar((char)nextByte))
760 {
761 break;
762 }
763 continue;
764 }
765 if (nextByte == 239)
766 {
767 flag = (flag4 = true);
768 continue;
769 }
770 char c3 = s_IndicMapping[num2, 0, nextByte - 160];
771 char c4 = s_IndicMapping[num2, 1, nextByte - 160];
772 if (c4 == '\0' || nextByte == 233)
773 {
774 if (c3 == '\0')
775 {
776 if (!encodingCharBuffer.Fallback(nextByte))
777 {
778 break;
779 }
780 }
781 else if (!encodingCharBuffer.AddChar(c3))
782 {
783 break;
784 }
785 }
786 else if (nextByte == 232)
787 {
788 if (!encodingCharBuffer.AddChar(c3))
789 {
790 break;
791 }
792 flag2 = (flag4 = true);
793 }
794 else if ((c4 & 0xF000) == 0)
795 {
796 flag4 = true;
797 c = c4;
798 c2 = c3;
799 }
800 else
801 {
802 flag3 = (flag4 = true);
803 }
804 }
805 if (iSCIIDecoder == null || iSCIIDecoder.MustFlush)
806 {
807 if (flag)
808 {
809 if (encodingCharBuffer.Fallback(239))
810 {
811 flag = false;
812 }
813 else
814 {
815 encodingCharBuffer.GetNextByte();
816 }
817 }
818 else if (flag3)
819 {
820 if (encodingCharBuffer.Fallback(240))
821 {
822 flag3 = false;
823 }
824 else
825 {
826 encodingCharBuffer.GetNextByte();
827 }
828 }
829 else if (c2 != 0)
830 {
831 if (encodingCharBuffer.AddChar(c2))
832 {
833 c2 = (c = '\0');
834 }
835 else
836 {
837 encodingCharBuffer.GetNextByte();
838 }
839 }
840 }
841 if (iSCIIDecoder != null && chars != null)
842 {
843 if (!iSCIIDecoder.MustFlush || c2 != '\0' || flag || flag3)
844 {
851 }
852 else
853 {
856 iSCIIDecoder.bLastATR = false;
860 }
862 }
863 return encodingCharBuffer.Count;
864 }
865
866 public override Decoder GetDecoder()
867 {
868 return new ISCIIDecoder(this);
869 }
870
871 public override Encoder GetEncoder()
872 {
873 return new ISCIIEncoder(this);
874 }
875
876 public override int GetHashCode()
877 {
878 return _defaultCodePage + base.EncoderFallback.GetHashCode() + base.DecoderFallback.GetHashCode();
879 }
880}
static string ArgumentOutOfRange_GetCharCountOverflow
Definition SR.cs:90
static string ArgumentOutOfRange_GetByteCountOverflow
Definition SR.cs:88
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_CodepageNotSupported
Definition SR.cs:522
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7
DecoderFallbackBuffer m_fallbackBuffer
Definition DecoderNLS.cs:17
EncoderFallbackBuffer m_fallbackBuffer
Definition EncoderNLS.cs:19
unsafe override int GetChars(byte *bytes, int byteCount, char *chars, int charCount, System.Text.DecoderNLS baseDecoder)
unsafe override int GetCharCount(byte *bytes, int count, System.Text.DecoderNLS baseDecoder)
override int GetMaxByteCount(int charCount)
unsafe override int GetByteCount(char *chars, int count, System.Text.EncoderNLS baseEncoder)
override Decoder GetDecoder()
static readonly byte[] s_SecondIndicByte
static readonly int[] s_UnicodeToIndicChar
static readonly char[,,] s_IndicMapping
static readonly int[] s_IndicMappingIndex
override Encoder GetEncoder()
override int GetMaxCharCount(int byteCount)
unsafe override int GetBytes(char *chars, int charCount, byte *bytes, int byteCount, System.Text.EncoderNLS baseEncoder)
void GetObjectData(SerializationInfo info, StreamingContext context)