Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CultureData.cs
Go to the documentation of this file.
5using System.Text;
7
9
10internal sealed class CultureData
11{
51
52 private enum LocaleGroupingData : uint
53 {
54 Digit = 16u,
55 Monetary = 24u
56 }
57
58 private enum LocaleNumberData : uint
59 {
60 LanguageId = 1u,
61 GeoId = 91u,
62 DigitSubstitution = 4116u,
69 CalendarType = 4105u,
70 FirstDayOfWeek = 4108u,
71 FirstWeekOfYear = 4109u,
72 ReadingLayout = 112u,
75 OemCodePage = 11u,
76 AnsiCodePage = 4100u,
77 MacCodePage = 4113u,
78 EbcdicCodePage = 4114u
79 }
80
81 private struct EnumLocaleData
82 {
83 public string regionName;
84
85 public string cultureName;
86 }
87
88 private struct EnumData
89 {
91 }
92
93 private string _sRealName;
94
95 private string _sWindowsName;
96
97 private string _sName;
98
99 private string _sParent;
100
101 private string _sEnglishDisplayName;
102
103 private string _sNativeDisplayName;
104
105 private string _sSpecificCulture;
106
107 private string _sISO639Language;
108
109 private string _sISO639Language2;
110
111 private string _sEnglishLanguage;
112
113 private string _sNativeLanguage;
114
115 private string _sAbbrevLang;
116
117 private string _sConsoleFallbackName;
118
119 private int _iInputLanguageHandle = -1;
120
121 private string _sRegionName;
122
123 private string _sLocalizedCountry;
124
125 private string _sEnglishCountry;
126
127 private string _sNativeCountry;
128
129 private string _sISO3166CountryName;
130
131 private string _sISO3166CountryName2;
132
133 private int _iGeoId = -1;
134
135 private string _sPositiveSign;
136
137 private string _sNegativeSign;
138
139 private int _iDigits;
140
141 private int _iNegativeNumber;
142
143 private int[] _waGrouping;
144
145 private string _sDecimalSeparator;
146
147 private string _sThousandSeparator;
148
149 private string _sNaN;
150
151 private string _sPositiveInfinity;
152
153 private string _sNegativeInfinity;
154
155 private int _iNegativePercent = -1;
156
157 private int _iPositivePercent = -1;
158
159 private string _sPercent;
160
161 private string _sPerMille;
162
163 private string _sCurrency;
164
165 private string _sIntlMonetarySymbol;
166
167 private string _sEnglishCurrency;
168
169 private string _sNativeCurrency;
170
171 private int _iCurrencyDigits;
172
173 private int _iCurrency;
174
176
177 private int[] _waMonetaryGrouping;
178
179 private string _sMonetaryDecimal;
180
181 private string _sMonetaryThousand;
182
183 private int _iMeasure = -1;
184
185 private string _sListSeparator;
186
187 private string _sAM1159;
188
189 private string _sPM2359;
190
191 private string _sTimeSeparator;
192
193 private volatile string[] _saLongTimes;
194
195 private volatile string[] _saShortTimes;
196
197 private volatile string[] _saDurationFormats;
198
199 private int _iFirstDayOfWeek = -1;
200
201 private int _iFirstWeekOfYear = -1;
202
203 private volatile CalendarId[] _waCalendars;
204
206
207 private int _iReadingLayout = -1;
208
209 private int _iDefaultAnsiCodePage = -1;
210
211 private int _iDefaultOemCodePage = -1;
212
213 private int _iDefaultMacCodePage = -1;
214
215 private int _iDefaultEbcdicCodePage = -1;
216
217 private int _iLanguage;
218
219 private bool _bUseOverrides;
220
222
223 private bool _bNeutral;
224
226
228
229 private static volatile CultureData s_Invariant;
230
232
233 private static readonly object s_lock = new object();
234
236 {
237 get
238 {
239 object obj = s_regionNames;
240 if (obj == null)
241 {
243 {
244 { "001", "en-001" },
245 { "029", "en-029" },
246 { "150", "en-150" },
247 { "419", "es-419" },
248 { "AD", "ca-AD" },
249 { "AE", "ar-AE" },
250 { "AF", "prs-AF" },
251 { "AG", "en-AG" },
252 { "AI", "en-AI" },
253 { "AL", "sq-AL" },
254 { "AM", "hy-AM" },
255 { "AO", "pt-AO" },
256 { "AQ", "en-A" },
257 { "AR", "es-AR" },
258 { "AS", "en-AS" },
259 { "AT", "de-AT" },
260 { "AU", "en-AU" },
261 { "AW", "nl-AW" },
262 { "AX", "sv-AX" },
263 { "AZ", "az-Cyrl-AZ" },
264 { "BA", "bs-Latn-BA" },
265 { "BB", "en-BB" },
266 { "BD", "bn-BD" },
267 { "BE", "nl-BE" },
268 { "BF", "fr-BF" },
269 { "BG", "bg-BG" },
270 { "BH", "ar-BH" },
271 { "BI", "rn-BI" },
272 { "BJ", "fr-BJ" },
273 { "BL", "fr-BL" },
274 { "BM", "en-BM" },
275 { "BN", "ms-BN" },
276 { "BO", "es-BO" },
277 { "BQ", "nl-BQ" },
278 { "BR", "pt-BR" },
279 { "BS", "en-BS" },
280 { "BT", "dz-BT" },
281 { "BV", "nb-B" },
282 { "BW", "en-BW" },
283 { "BY", "be-BY" },
284 { "BZ", "en-BZ" },
285 { "CA", "en-CA" },
286 { "CC", "en-CC" },
287 { "CD", "fr-CD" },
288 { "CF", "sg-CF" },
289 { "CG", "fr-CG" },
290 { "CH", "it-CH" },
291 { "CI", "fr-CI" },
292 { "CK", "en-CK" },
293 { "CL", "es-CL" },
294 { "CM", "fr-C" },
295 { "CN", "zh-CN" },
296 { "CO", "es-CO" },
297 { "CR", "es-CR" },
298 { "CS", "sr-Cyrl-CS" },
299 { "CU", "es-CU" },
300 { "CV", "pt-CV" },
301 { "CW", "nl-CW" },
302 { "CX", "en-CX" },
303 { "CY", "el-CY" },
304 { "CZ", "cs-CZ" },
305 { "DE", "de-DE" },
306 { "DJ", "fr-DJ" },
307 { "DK", "da-DK" },
308 { "DM", "en-DM" },
309 { "DO", "es-DO" },
310 { "DZ", "ar-DZ" },
311 { "EC", "es-EC" },
312 { "EE", "et-EE" },
313 { "EG", "ar-EG" },
314 { "ER", "tig-ER" },
315 { "ES", "es-ES" },
316 { "ET", "am-ET" },
317 { "FI", "fi-FI" },
318 { "FJ", "en-FJ" },
319 { "FK", "en-FK" },
320 { "FM", "en-FM" },
321 { "FO", "fo-FO" },
322 { "FR", "fr-FR" },
323 { "GA", "fr-GA" },
324 { "GB", "en-GB" },
325 { "GD", "en-GD" },
326 { "GE", "ka-GE" },
327 { "GF", "fr-GF" },
328 { "GG", "en-GG" },
329 { "GH", "en-GH" },
330 { "GI", "en-GI" },
331 { "GL", "kl-GL" },
332 { "GM", "en-GM" },
333 { "GN", "fr-GN" },
334 { "GP", "fr-GP" },
335 { "GQ", "es-GQ" },
336 { "GR", "el-GR" },
337 { "GS", "en-G" },
338 { "GT", "es-GT" },
339 { "GU", "en-GU" },
340 { "GW", "pt-GW" },
341 { "GY", "en-GY" },
342 { "HK", "zh-HK" },
343 { "HM", "en-H" },
344 { "HN", "es-HN" },
345 { "HR", "hr-HR" },
346 { "HT", "fr-HT" },
347 { "HU", "hu-HU" },
348 { "ID", "id-ID" },
349 { "IE", "en-IE" },
350 { "IL", "he-IL" },
351 { "IM", "gv-IM" },
352 { "IN", "hi-IN" },
353 { "IO", "en-IO" },
354 { "IQ", "ar-IQ" },
355 { "IR", "fa-IR" },
356 { "IS", "is-IS" },
357 { "IT", "it-IT" },
358 { "IV", "" },
359 { "JE", "en-JE" },
360 { "JM", "en-JM" },
361 { "JO", "ar-JO" },
362 { "JP", "ja-JP" },
363 { "KE", "sw-KE" },
364 { "KG", "ky-KG" },
365 { "KH", "km-KH" },
366 { "KI", "en-KI" },
367 { "KM", "ar-KM" },
368 { "KN", "en-KN" },
369 { "KP", "ko-KP" },
370 { "KR", "ko-KR" },
371 { "KW", "ar-KW" },
372 { "KY", "en-KY" },
373 { "KZ", "kk-KZ" },
374 { "LA", "lo-LA" },
375 { "LB", "ar-LB" },
376 { "LC", "en-LC" },
377 { "LI", "de-LI" },
378 { "LK", "si-LK" },
379 { "LR", "en-LR" },
380 { "LS", "st-LS" },
381 { "LT", "lt-LT" },
382 { "LU", "lb-LU" },
383 { "LV", "lv-LV" },
384 { "LY", "ar-LY" },
385 { "MA", "ar-MA" },
386 { "MC", "fr-MC" },
387 { "MD", "ro-MD" },
388 { "ME", "sr-Latn-ME" },
389 { "MF", "fr-MF" },
390 { "MG", "mg-MG" },
391 { "MH", "en-MH" },
392 { "MK", "mk-MK" },
393 { "ML", "fr-ML" },
394 { "MM", "my-MM" },
395 { "MN", "mn-MN" },
396 { "MO", "zh-MO" },
397 { "MP", "en-MP" },
398 { "MQ", "fr-MQ" },
399 { "MR", "ar-MR" },
400 { "MS", "en-MS" },
401 { "MT", "mt-MT" },
402 { "MU", "en-MU" },
403 { "MV", "dv-MV" },
404 { "MW", "en-MW" },
405 { "MX", "es-MX" },
406 { "MY", "ms-MY" },
407 { "MZ", "pt-MZ" },
408 { "NA", "en-NA" },
409 { "NC", "fr-NC" },
410 { "NE", "fr-NE" },
411 { "NF", "en-NF" },
412 { "NG", "ig-NG" },
413 { "NI", "es-NI" },
414 { "NL", "nl-NL" },
415 { "NO", "nn-NO" },
416 { "NP", "ne-NP" },
417 { "NR", "en-NR" },
418 { "NU", "en-NU" },
419 { "NZ", "en-NZ" },
420 { "OM", "ar-OM" },
421 { "PA", "es-PA" },
422 { "PE", "es-PE" },
423 { "PF", "fr-PF" },
424 { "PG", "en-PG" },
425 { "PH", "en-PH" },
426 { "PK", "ur-PK" },
427 { "PL", "pl-PL" },
428 { "PM", "fr-PM" },
429 { "PN", "en-PN" },
430 { "PR", "es-PR" },
431 { "PS", "ar-PS" },
432 { "PT", "pt-PT" },
433 { "PW", "en-PW" },
434 { "PY", "es-PY" },
435 { "QA", "ar-QA" },
436 { "RE", "fr-RE" },
437 { "RO", "ro-RO" },
438 { "RS", "sr-Latn-RS" },
439 { "RU", "ru-RU" },
440 { "RW", "rw-RW" },
441 { "SA", "ar-SA" },
442 { "SB", "en-SB" },
443 { "SC", "fr-SC" },
444 { "SD", "ar-SD" },
445 { "SE", "sv-SE" },
446 { "SG", "zh-SG" },
447 { "SH", "en-SH" },
448 { "SI", "sl-SI" },
449 { "SJ", "nb-SJ" },
450 { "SK", "sk-SK" },
451 { "SL", "en-SL" },
452 { "SM", "it-SM" },
453 { "SN", "wo-SN" },
454 { "SO", "so-SO" },
455 { "SR", "nl-SR" },
456 { "SS", "en-SS" },
457 { "ST", "pt-ST" },
458 { "SV", "es-SV" },
459 { "SX", "nl-SX" },
460 { "SY", "ar-SY" },
461 { "SZ", "ss-SZ" },
462 { "TC", "en-TC" },
463 { "TD", "fr-TD" },
464 { "TF", "fr-T" },
465 { "TG", "fr-TG" },
466 { "TH", "th-TH" },
467 { "TJ", "tg-Cyrl-TJ" },
468 { "TK", "en-TK" },
469 { "TL", "pt-TL" },
470 { "TM", "tk-TM" },
471 { "TN", "ar-TN" },
472 { "TO", "to-TO" },
473 { "TR", "tr-TR" },
474 { "TT", "en-TT" },
475 { "TV", "en-TV" },
476 { "TW", "zh-TW" },
477 { "TZ", "sw-TZ" },
478 { "UA", "uk-UA" },
479 { "UG", "sw-UG" },
480 { "UM", "en-UM" },
481 { "US", "en-US" },
482 { "UY", "es-UY" },
483 { "UZ", "uz-Cyrl-UZ" },
484 { "VA", "it-VA" },
485 { "VC", "en-VC" },
486 { "VE", "es-VE" },
487 { "VG", "en-VG" },
488 { "VI", "en-VI" },
489 { "VN", "vi-VN" },
490 { "VU", "fr-VU" },
491 { "WF", "fr-WF" },
492 { "WS", "en-WS" },
493 { "XK", "sq-XK" },
494 { "YE", "ar-YE" },
495 { "YT", "fr-YT" },
496 { "ZA", "af-ZA" },
497 { "ZM", "en-ZM" },
498 { "ZW", "en-ZW" }
499 };
501 }
503 }
504 }
505
507
508 internal string CultureName
509 {
510 get
511 {
512 string sName = _sName;
513 if (sName == "zh-CHS" || sName == "zh-CHT")
514 {
515 return _sName;
516 }
517 return _sRealName;
518 }
519 }
520
522
523 internal string Name => _sName ?? string.Empty;
524
526
527 internal string DisplayName
528 {
529 get
530 {
531 string text = NativeName;
532 if (!GlobalizationMode.Invariant && Name.Length > 0)
533 {
534 try
535 {
536 text = GetLanguageDisplayNameCore(Name.Equals("zh-CHT", StringComparison.OrdinalIgnoreCase) ? "zh-Hant" : (Name.Equals("zh-CHS", StringComparison.OrdinalIgnoreCase) ? "zh-Hans" : Name));
537 }
538 catch
539 {
540 }
541 if (string.IsNullOrEmpty(text) && IsNeutralCulture)
542 {
544 }
545 }
546 return text;
547 }
548 }
549
550 internal string EnglishName
551 {
552 get
553 {
554 string text = _sEnglishDisplayName;
555 if (text == null && !GlobalizationMode.Invariant)
556 {
558 {
559 text = GetLocaleInfoCore(LocaleStringData.EnglishDisplayName);
560 if (string.IsNullOrEmpty(text))
561 {
563 }
564 string sName = _sName;
565 if (sName == "zh-CHS" || sName == "zh-CHT")
566 {
567 text += " Legacy";
568 }
569 }
570 else
571 {
572 text = GetLocaleInfoCore(LocaleStringData.EnglishDisplayName);
573 if (string.IsNullOrEmpty(text))
574 {
575 text = ((EnglishLanguageName[^1] != ')') ? (EnglishLanguageName + " (" + EnglishCountryName + ")") : string.Concat(EnglishLanguageName.AsSpan(0, _sEnglishLanguage.Length - 1), ", ", EnglishCountryName, ")"));
576 }
577 }
579 }
580 return text;
581 }
582 }
583
584 internal string NativeName
585 {
586 get
587 {
588 string text = _sNativeDisplayName;
589 if (text == null && !GlobalizationMode.Invariant)
590 {
592 {
593 text = GetLocaleInfoCore(LocaleStringData.NativeDisplayName);
594 if (string.IsNullOrEmpty(text))
595 {
597 }
598 string sName = _sName;
599 if (!(sName == "zh-CHS"))
600 {
601 if (sName == "zh-CHT")
602 {
603 text += " 舊版";
604 }
605 }
606 else
607 {
608 text += " 旧版";
609 }
610 }
611 else
612 {
613 text = GetLocaleInfoCore(LocaleStringData.NativeDisplayName);
614 if (string.IsNullOrEmpty(text))
615 {
617 }
618 }
620 }
621 return text;
622 }
623 }
624
626
628
630
632
634 {
635 get
636 {
637 string result = NativeLanguageName;
639 {
640 result = GetLocaleInfoCore(LocaleStringData.LocalizedLanguageName, CultureInfo.CurrentUICulture.Name);
641 }
642 return result;
643 }
644 }
645
647
649
650 internal string RegionName => _sRegionName ?? (_sRegionName = GetLocaleInfoCore(LocaleStringData.Iso3166CountryName));
651
652 internal int GeoId
653 {
654 get
655 {
656 if (_iGeoId == -1 && !GlobalizationMode.Invariant)
657 {
658 _iGeoId = (GlobalizationMode.UseNls ? NlsGetLocaleInfo(LocaleNumberData.GeoId) : IcuGetGeoId(_sRealName));
659 }
660 return _iGeoId;
661 }
662 }
663
664 internal string LocalizedCountryName
665 {
666 get
667 {
668 string text = _sLocalizedCountry;
669 if (text == null && !GlobalizationMode.Invariant)
670 {
671 try
672 {
673 text = (GlobalizationMode.UseNls ? NlsGetRegionDisplayName() : IcuGetRegionDisplayName());
674 }
675 catch
676 {
677 }
678 if (text == null)
679 {
681 }
683 }
684 return text;
685 }
686 }
687
689
691
693
695
696 internal int KeyboardLayoutId
697 {
698 get
699 {
700 if (_iInputLanguageHandle == -1)
701 {
703 {
705 }
706 else
707 {
709 }
710 }
712 }
713 }
714
716
718
719 private string NaNSymbol => _sNaN ?? (_sNaN = GetLocaleInfoCore(LocaleStringData.NaNSymbol));
720
722
724
726 {
727 get
728 {
729 if (_iNegativePercent == -1)
730 {
732 }
733 return _iNegativePercent;
734 }
735 }
736
738 {
739 get
740 {
741 if (_iPositivePercent == -1)
742 {
744 }
745 return _iPositivePercent;
746 }
747 }
748
749 private string PercentSymbol => _sPercent ?? (_sPercent = GetLocaleInfoCore(LocaleStringData.PercentSymbol));
750
752
754
756
758
760
762
763 internal int MeasurementSystem
764 {
765 get
766 {
767 if (_iMeasure == -1)
768 {
770 }
771 return _iMeasure;
772 }
773 }
774
776
778
780
781 internal string[] LongTimes
782 {
783 get
784 {
786 {
788 if (timeFormatsCore == null || timeFormatsCore.Length == 0)
789 {
790 _saLongTimes = Invariant._saLongTimes;
791 }
792 else
793 {
795 }
796 }
797 return _saLongTimes;
798 }
799 }
800
801 internal string[] ShortTimes
802 {
803 get
804 {
806 {
807 string[] array = GetTimeFormatsCore(shortFormat: true);
808 if (array == null || array.Length == 0)
809 {
811 }
813 }
814 return _saShortTimes;
815 }
816 }
817
818 internal int FirstDayOfWeek
819 {
820 get
821 {
823 {
825 }
826 return _iFirstDayOfWeek;
827 }
828 }
829
830 internal int CalendarWeekRule
831 {
832 get
833 {
834 if (_iFirstWeekOfYear == -1)
835 {
837 }
838 return _iFirstWeekOfYear;
839 }
840 }
841
843 {
844 get
845 {
847 {
848 CalendarId[] array = new CalendarId[23];
850 if (num == 0)
851 {
852 _waCalendars = Invariant._waCalendars;
853 }
854 else
855 {
856 if (_sWindowsName == "zh-TW")
857 {
858 bool flag = false;
859 for (int i = 0; i < num; i++)
860 {
861 if (array[i] == CalendarId.TAIWAN)
862 {
863 flag = true;
864 break;
865 }
866 }
867 if (!flag)
868 {
869 num++;
870 Array.Copy(array, 1, array, 2, 21);
871 array[1] = CalendarId.TAIWAN;
872 }
873 }
874 CalendarId[] array2 = new CalendarId[num];
875 Array.Copy(array, array2, num);
877 }
878 }
879 return _waCalendars;
880 }
881 }
882
883 internal bool IsRightToLeft => ReadingLayout == 1;
884
885 private int ReadingLayout
886 {
887 get
888 {
890 {
892 }
893 return _iReadingLayout;
894 }
895 }
896
897 internal string TextInfoName => _sRealName;
898
899 internal string SortName => _sRealName;
900
902
903 internal int ANSICodePage
904 {
905 get
906 {
908 {
910 }
912 }
913 }
914
915 internal int OEMCodePage
916 {
917 get
918 {
920 {
922 }
924 }
925 }
926
927 internal int MacCodePage
928 {
929 get
930 {
932 {
934 }
936 }
937 }
938
939 internal int EBCDICCodePage
940 {
941 get
942 {
944 {
946 }
948 }
949 }
950
951 internal int LCID
952 {
953 get
954 {
956 {
958 }
959 return _iLanguage;
960 }
961 }
962
963 internal bool IsNeutralCulture => _bNeutral;
964
965 internal bool IsInvariantCulture => string.IsNullOrEmpty(Name);
966
968 {
969 get
970 {
972 {
973 return false;
974 }
976 }
977 }
978
980 {
981 get
982 {
984 {
985 return new GregorianCalendar();
986 }
988 if (calendarId == CalendarId.UNINITIALIZED_VALUE)
989 {
991 }
993 }
994 }
995
996 internal string TimeSeparator
997 {
998 get
999 {
1001 {
1002 if (_sName == "fr-CA")
1003 {
1004 _sTimeSeparator = ":";
1005 }
1006 else
1007 {
1009 if (string.IsNullOrEmpty(text))
1010 {
1011 text = LongTimes[0];
1012 }
1014 }
1015 }
1016 return _sTimeSeparator;
1017 }
1018 }
1019
1020 internal unsafe bool NlsIsReplacementCulture
1021 {
1022 get
1023 {
1024 EnumData value = default(EnumData);
1025 value.strings = new List<string>();
1027 for (int i = 0; i < value.strings.Count; i++)
1028 {
1029 if (string.Equals(value.strings[i], _sWindowsName, StringComparison.OrdinalIgnoreCase))
1030 {
1031 return true;
1032 }
1033 }
1034 return false;
1035 }
1036 }
1037
1038 internal static bool IsWin32Installed => true;
1039
1041 {
1042 get
1043 {
1045 {
1046 return _bUseOverrides;
1047 }
1048 return true;
1049 }
1050 }
1051
1052 internal static CultureData GetCultureDataForRegion(string cultureName, bool useUserOverride)
1053 {
1054 if (string.IsNullOrEmpty(cultureName))
1055 {
1056 return Invariant;
1057 }
1058 CultureData cultureData = null;
1060 if (cultureData != null && !cultureData.IsNeutralCulture)
1061 {
1062 return cultureData;
1063 }
1065 string key = AnsiToLower(useUserOverride ? cultureName : (cultureName + "*"));
1067 if (dictionary == null)
1068 {
1070 }
1071 else
1072 {
1073 lock (s_lock)
1074 {
1076 }
1077 if (cultureData != null)
1078 {
1079 return cultureData;
1080 }
1081 }
1082 if ((cultureData == null || cultureData.IsNeutralCulture) && RegionNames.TryGetValue(cultureName, out var value))
1083 {
1085 }
1086 if (!GlobalizationMode.Invariant && (cultureData == null || cultureData.IsNeutralCulture))
1087 {
1088 cultureData = (GlobalizationMode.UseNls ? NlsGetCultureDataFromRegionName(cultureName) : IcuGetCultureDataFromRegionName(cultureName));
1089 }
1090 if (cultureData != null && !cultureData.IsNeutralCulture)
1091 {
1092 lock (s_lock)
1093 {
1095 }
1097 }
1098 else
1099 {
1101 }
1102 return cultureData;
1103 }
1104
1105 internal static void ClearCachedData()
1106 {
1107 s_cachedCultures = null;
1108 s_cachedRegions = null;
1109 }
1110
1112 {
1113 if (types <= (CultureTypes)0 || ((uint)types & 0xFFFFFF80u) != 0)
1114 {
1115 throw new ArgumentOutOfRangeException("types", SR.Format(SR.ArgumentOutOfRange_Range, CultureTypes.NeutralCultures, CultureTypes.FrameworkCultures));
1116 }
1117 if ((types & CultureTypes.WindowsOnlyCultures) != 0)
1118 {
1119 types &= ~CultureTypes.WindowsOnlyCultures;
1120 }
1122 {
1123 return new CultureInfo[1]
1124 {
1125 new CultureInfo("")
1126 };
1127 }
1129 {
1130 return IcuEnumCultures(types);
1131 }
1132 return NlsEnumCultures(types);
1133 }
1134
1136 {
1138 cultureData._bUseOverrides = false;
1139 cultureData._bUseOverridesUserSetting = false;
1140 cultureData._sRealName = "";
1141 cultureData._sWindowsName = "";
1142 cultureData._sName = "";
1143 cultureData._sParent = "";
1144 cultureData._bNeutral = false;
1145 cultureData._sEnglishDisplayName = "Invariant Language (Invariant Country)";
1146 cultureData._sNativeDisplayName = "Invariant Language (Invariant Country)";
1147 cultureData._sSpecificCulture = "";
1148 cultureData._sISO639Language = "iv";
1149 cultureData._sISO639Language2 = "ivl";
1150 cultureData._sEnglishLanguage = "Invariant Language";
1151 cultureData._sNativeLanguage = "Invariant Language";
1152 cultureData._sAbbrevLang = "IVL";
1153 cultureData._sConsoleFallbackName = "";
1154 cultureData._iInputLanguageHandle = 127;
1155 cultureData._sRegionName = "IV";
1156 cultureData._sEnglishCountry = "Invariant Country";
1157 cultureData._sNativeCountry = "Invariant Country";
1158 cultureData._sISO3166CountryName = "IV";
1159 cultureData._sISO3166CountryName2 = "ivc";
1160 cultureData._iGeoId = 244;
1161 cultureData._sPositiveSign = "+";
1162 cultureData._sNegativeSign = "-";
1163 cultureData._iDigits = 2;
1164 cultureData._iNegativeNumber = 1;
1165 cultureData._waGrouping = new int[1] { 3 };
1166 cultureData._sDecimalSeparator = ".";
1167 cultureData._sThousandSeparator = ",";
1168 cultureData._sNaN = "NaN";
1169 cultureData._sPositiveInfinity = "Infinity";
1170 cultureData._sNegativeInfinity = "-Infinity";
1171 cultureData._iNegativePercent = 0;
1172 cultureData._iPositivePercent = 0;
1173 cultureData._sPercent = "%";
1174 cultureData._sPerMille = "‰";
1175 cultureData._sCurrency = "¤";
1176 cultureData._sIntlMonetarySymbol = "XDR";
1177 cultureData._sEnglishCurrency = "International Monetary Fund";
1178 cultureData._sNativeCurrency = "International Monetary Fund";
1179 cultureData._iCurrencyDigits = 2;
1180 cultureData._iCurrency = 0;
1181 cultureData._iNegativeCurrency = 0;
1182 cultureData._waMonetaryGrouping = new int[1] { 3 };
1183 cultureData._sMonetaryDecimal = ".";
1184 cultureData._sMonetaryThousand = ",";
1185 cultureData._iMeasure = 0;
1186 cultureData._sListSeparator = ",";
1187 cultureData._sTimeSeparator = ":";
1188 cultureData._sAM1159 = "AM";
1189 cultureData._sPM2359 = "PM";
1190 cultureData._saLongTimes = new string[1] { "HH:mm:ss" };
1191 cultureData._saShortTimes = new string[4] { "HH:mm", "hh:mm tt", "H:mm", "h:mm tt" };
1192 cultureData._saDurationFormats = new string[1] { "HH:mm:ss" };
1193 cultureData._iFirstDayOfWeek = 0;
1194 cultureData._iFirstWeekOfYear = 0;
1195 cultureData._waCalendars = new CalendarId[1] { CalendarId.GREGORIAN };
1197 {
1198 cultureData._calendars = new CalendarData[23];
1199 cultureData._calendars[0] = CalendarData.Invariant;
1200 }
1201 cultureData._iReadingLayout = 0;
1202 cultureData._iLanguage = 127;
1203 cultureData._iDefaultAnsiCodePage = 1252;
1204 cultureData._iDefaultOemCodePage = 437;
1205 cultureData._iDefaultMacCodePage = 10000;
1206 cultureData._iDefaultEbcdicCodePage = 37;
1208 {
1209 cultureData._sLocalizedCountry = cultureData._sNativeCountry;
1210 }
1211 return cultureData;
1212 }
1213
1214 internal static CultureData GetCultureData(string cultureName, bool useUserOverride)
1215 {
1216 if (string.IsNullOrEmpty(cultureName))
1217 {
1218 return Invariant;
1219 }
1221 {
1222 return null;
1223 }
1224 string key = AnsiToLower(useUserOverride ? cultureName : (cultureName + "*"));
1226 if (dictionary == null)
1227 {
1229 }
1230 else
1231 {
1232 bool flag;
1234 lock (s_lock)
1235 {
1236 flag = dictionary.TryGetValue(key, out value);
1237 }
1238 if (flag && value != null)
1239 {
1240 return value;
1241 }
1242 }
1244 if (cultureData == null)
1245 {
1246 return null;
1247 }
1248 lock (s_lock)
1249 {
1251 }
1253 return cultureData;
1254 }
1255
1256 private static string NormalizeCultureName(string name, out bool isNeutralName)
1257 {
1258 isNeutralName = true;
1259 int i = 0;
1260 if (name.Length > 85)
1261 {
1262 throw new ArgumentException(SR.Format(SR.Argument_InvalidId, "name"));
1263 }
1264 Span<char> span = stackalloc char[name.Length];
1265 bool flag = false;
1266 for (; i < name.Length && name[i] != '-' && name[i] != '_'; i++)
1267 {
1268 if (name[i] >= 'A' && name[i] <= 'Z')
1269 {
1270 span[i] = (char)(name[i] + 32);
1271 flag = true;
1272 }
1273 else
1274 {
1275 span[i] = name[i];
1276 }
1277 }
1278 if (i < name.Length)
1279 {
1280 isNeutralName = false;
1281 }
1282 for (; i < name.Length; i++)
1283 {
1284 if (name[i] >= 'a' && name[i] <= 'z')
1285 {
1286 span[i] = (char)(name[i] - 32);
1287 flag = true;
1288 }
1289 else
1290 {
1291 span[i] = name[i];
1292 }
1293 }
1294 if (flag)
1295 {
1296 return new string(span);
1297 }
1298 return name;
1299 }
1300
1301 private static CultureData CreateCultureData(string cultureName, bool useUserOverride)
1302 {
1304 {
1305 if (cultureName.Length > 85 || !CultureInfo.VerifyCultureName(cultureName, throwException: false))
1306 {
1307 return null;
1308 }
1310 cultureData._sName = NormalizeCultureName(cultureName, out cultureData._bNeutral);
1311 cultureData._bUseOverridesUserSetting = useUserOverride;
1312 cultureData._sRealName = cultureData._sName;
1313 cultureData._sWindowsName = cultureData._sName;
1314 cultureData._iLanguage = 4096;
1315 return cultureData;
1316 }
1317 if (cultureName.Length == 1 && (cultureName[0] == 'C' || cultureName[0] == 'c'))
1318 {
1319 return Invariant;
1320 }
1322 cultureData2._sRealName = cultureName;
1323 cultureData2._bUseOverridesUserSetting = useUserOverride;
1324 if (!cultureData2.InitCultureDataCore() && !cultureData2.InitCompatibilityCultureData())
1325 {
1326 return null;
1327 }
1328 cultureData2.InitUserOverride(useUserOverride);
1329 return cultureData2;
1330 }
1331
1333 {
1334 string sRealName = _sRealName;
1335 string text = AnsiToLower(sRealName);
1336 string text2;
1337 string sName;
1338 if (!(text == "zh-chs"))
1339 {
1340 if (!(text == "zh-cht"))
1341 {
1342 return false;
1343 }
1344 text2 = "zh-Hant";
1345 sName = "zh-CHT";
1346 }
1347 else
1348 {
1349 text2 = "zh-Hans";
1350 sName = "zh-CHS";
1351 }
1352 _sRealName = text2;
1353 if (!InitCultureDataCore())
1354 {
1355 return false;
1356 }
1357 _sName = sName;
1358 _sParent = text2;
1359 return true;
1360 }
1361
1363 {
1364 string text = null;
1365 CultureData cultureData = null;
1366 if (culture == 127)
1367 {
1368 return Invariant;
1369 }
1371 {
1373 }
1375 if (!string.IsNullOrEmpty(text))
1376 {
1378 }
1379 if (cultureData == null)
1380 {
1382 }
1383 return cultureData;
1384 }
1385
1386 private string GetLanguageDisplayNameCore(string cultureName)
1387 {
1389 {
1390 return IcuGetLanguageDisplayName(cultureName);
1391 }
1392 return NlsGetLanguageDisplayName(cultureName);
1393 }
1394
1395 private string[] DeriveShortTimesFromLong()
1396 {
1397 string[] longTimes = LongTimes;
1398 string[] array = new string[longTimes.Length];
1399 for (int i = 0; i < longTimes.Length; i++)
1400 {
1402 }
1403 return array;
1404 }
1405
1406 private static string StripSecondsFromPattern(string time)
1407 {
1408 bool flag = false;
1409 int num = -1;
1410 for (int i = 0; i < time.Length; i++)
1411 {
1412 if (time[i] == '\'')
1413 {
1414 flag = !flag;
1415 }
1416 else if (time[i] == '\\')
1417 {
1418 i++;
1419 }
1420 else
1421 {
1422 if (flag)
1423 {
1424 continue;
1425 }
1426 switch (time[i])
1427 {
1428 case 's':
1429 {
1430 if (i - num <= 4 && i - num > 1 && time[num + 1] != '\'' && time[i - 1] != '\'' && num >= 0)
1431 {
1432 i = num + 1;
1433 }
1434 bool containsSpace;
1436 time = string.Concat(str1: (!containsSpace) ? "" : " ", str0: time.AsSpan(0, i), str2: time.AsSpan(indexOfNextTokenAfterSeconds));
1437 break;
1438 }
1439 case 'H':
1440 case 'h':
1441 case 'm':
1442 num = i;
1443 break;
1444 }
1445 }
1446 }
1447 return time;
1448 }
1449
1450 private static int GetIndexOfNextTokenAfterSeconds(string time, int index, out bool containsSpace)
1451 {
1452 bool flag = false;
1453 containsSpace = false;
1454 while (index < time.Length)
1455 {
1456 switch (time[index])
1457 {
1458 case '\'':
1459 flag = !flag;
1460 break;
1461 case '\\':
1462 index++;
1463 if (time[index] == ' ')
1464 {
1465 containsSpace = true;
1466 }
1467 break;
1468 case ' ':
1469 containsSpace = true;
1470 break;
1471 case 'H':
1472 case 'h':
1473 case 'm':
1474 case 't':
1475 if (!flag)
1476 {
1477 return index;
1478 }
1479 break;
1480 }
1481 index++;
1482 }
1483 containsSpace = false;
1484 return index;
1485 }
1486
1488 {
1490 }
1491
1493 {
1495 }
1496
1498 {
1500 }
1501
1502 internal string[] DayNames(CalendarId calendarId)
1503 {
1505 }
1506
1508 {
1510 }
1511
1516
1518 {
1520 }
1521
1526
1531
1536
1541
1543 {
1545 }
1546
1548 {
1550 }
1551
1553 {
1555 {
1556 return CalendarData.Invariant;
1557 }
1558 int num = (int)(calendarId - 1);
1559 if (_calendars == null)
1560 {
1561 _calendars = new CalendarData[23];
1562 }
1564 if (calendarData == null)
1565 {
1567 _calendars[num] = calendarData;
1568 }
1569 return calendarData;
1570 }
1571
1572 internal string[] EraNames(CalendarId calendarId)
1573 {
1575 }
1576
1578 {
1580 }
1581
1586
1588 {
1590 {
1591 return "/";
1592 }
1594 {
1595 return "/";
1596 }
1598 }
1599
1600 private static string UnescapeNlsString(string str, int start, int end)
1601 {
1603 for (int i = start; i < str.Length && i <= end; i++)
1604 {
1605 switch (str[i])
1606 {
1607 case '\'':
1608 if (stringBuilder == null)
1609 {
1610 stringBuilder = new StringBuilder(str, start, i - start, str.Length);
1611 }
1612 break;
1613 case '\\':
1614 if (stringBuilder == null)
1615 {
1616 stringBuilder = new StringBuilder(str, start, i - start, str.Length);
1617 }
1618 i++;
1619 if (i < str.Length)
1620 {
1621 stringBuilder.Append(str[i]);
1622 }
1623 break;
1624 default:
1625 stringBuilder?.Append(str[i]);
1626 break;
1627 }
1628 }
1629 if (stringBuilder == null)
1630 {
1631 return str.Substring(start, end - start + 1);
1632 }
1633 return stringBuilder.ToString();
1634 }
1635
1636 private static string GetTimeSeparator(string format)
1637 {
1638 return GetSeparator(format, "Hhms");
1639 }
1640
1641 private static string GetDateSeparator(string format)
1642 {
1643 return GetSeparator(format, "dyM");
1644 }
1645
1646 private static string GetSeparator(string format, string timeParts)
1647 {
1648 int num = IndexOfTimePart(format, 0, timeParts);
1649 if (num != -1)
1650 {
1651 char c = format[num];
1652 do
1653 {
1654 num++;
1655 }
1656 while (num < format.Length && format[num] == c);
1657 int num2 = num;
1658 if (num2 < format.Length)
1659 {
1661 if (num3 != -1)
1662 {
1663 return UnescapeNlsString(format, num2, num3 - 1);
1664 }
1665 }
1666 }
1667 return string.Empty;
1668 }
1669
1670 private static int IndexOfTimePart(string format, int startIndex, string timeParts)
1671 {
1672 bool flag = false;
1673 for (int i = startIndex; i < format.Length; i++)
1674 {
1675 if (!flag && timeParts.Contains(format[i]))
1676 {
1677 return i;
1678 }
1679 switch (format[i])
1680 {
1681 case '\\':
1682 if (i + 1 < format.Length)
1683 {
1684 i++;
1685 char c = format[i];
1686 if (c != '\'' && c != '\\')
1687 {
1688 i--;
1689 }
1690 }
1691 break;
1692 case '\'':
1693 flag = !flag;
1694 break;
1695 }
1696 }
1697 return -1;
1698 }
1699
1700 internal static bool IsCustomCultureId(int cultureId)
1701 {
1702 if (cultureId != 3072)
1703 {
1704 return cultureId == 4096;
1705 }
1706 return true;
1707 }
1708
1710 {
1712 {
1713 nfi._positiveSign = _sPositiveSign;
1714 nfi._negativeSign = _sNegativeSign;
1715 nfi._numberGroupSeparator = _sThousandSeparator;
1716 nfi._numberDecimalSeparator = _sDecimalSeparator;
1717 nfi._numberDecimalDigits = _iDigits;
1718 nfi._numberNegativePattern = _iNegativeNumber;
1719 nfi._currencySymbol = _sCurrency;
1720 nfi._currencyGroupSeparator = _sMonetaryThousand;
1721 nfi._currencyDecimalSeparator = _sMonetaryDecimal;
1722 nfi._currencyDecimalDigits = _iCurrencyDigits;
1723 nfi._currencyNegativePattern = _iNegativeCurrency;
1724 nfi._currencyPositivePattern = _iCurrency;
1725 }
1726 else
1727 {
1728 nfi._positiveSign = GetLocaleInfoCoreUserOverride(LocaleStringData.PositiveSign);
1729 nfi._negativeSign = GetLocaleInfoCoreUserOverride(LocaleStringData.NegativeSign);
1730 nfi._numberDecimalSeparator = GetLocaleInfoCoreUserOverride(LocaleStringData.DecimalSeparator);
1731 nfi._numberGroupSeparator = GetLocaleInfoCoreUserOverride(LocaleStringData.ThousandSeparator);
1732 nfi._currencyGroupSeparator = GetLocaleInfoCoreUserOverride(LocaleStringData.MonetaryThousandSeparator);
1733 nfi._currencyDecimalSeparator = GetLocaleInfoCoreUserOverride(LocaleStringData.MonetaryDecimalSeparator);
1734 nfi._currencySymbol = GetLocaleInfoCoreUserOverride(LocaleStringData.MonetarySymbol);
1735 nfi._numberDecimalDigits = GetLocaleInfoCoreUserOverride(LocaleNumberData.FractionalDigitsCount);
1736 nfi._currencyDecimalDigits = GetLocaleInfoCoreUserOverride(LocaleNumberData.MonetaryFractionalDigitsCount);
1737 nfi._currencyPositivePattern = GetLocaleInfoCoreUserOverride(LocaleNumberData.PositiveMonetaryNumberFormat);
1738 nfi._currencyNegativePattern = GetLocaleInfoCoreUserOverride(LocaleNumberData.NegativeMonetaryNumberFormat);
1739 nfi._numberNegativePattern = GetLocaleInfoCoreUserOverride(LocaleNumberData.NegativeNumberFormat);
1741 nfi._nativeDigits = new string[10];
1742 for (int i = 0; i < nfi._nativeDigits.Length; i++)
1743 {
1744 nfi._nativeDigits[i] = char.ToString(localeInfoCoreUserOverride[i]);
1745 }
1746 nfi._digitSubstitution = (ShouldUseUserOverrideNlsData ? NlsGetLocaleInfo(LocaleNumberData.DigitSubstitution) : IcuGetDigitSubstitution(_sRealName));
1747 }
1748 nfi._numberGroupSizes = NumberGroupSizes;
1749 nfi._currencyGroupSizes = CurrencyGroupSizes;
1750 nfi._percentNegativePattern = PercentNegativePattern;
1751 nfi._percentPositivePattern = PercentPositivePattern;
1752 nfi._percentSymbol = PercentSymbol;
1753 nfi._perMilleSymbol = PerMilleSymbol;
1754 nfi._negativeInfinitySymbol = NegativeInfinitySymbol;
1755 nfi._positiveInfinitySymbol = PositiveInfinitySymbol;
1756 nfi._nanSymbol = NaNSymbol;
1757 nfi._percentDecimalDigits = nfi._numberDecimalDigits;
1758 nfi._percentDecimalSeparator = nfi._numberDecimalSeparator;
1759 nfi._percentGroupSizes = nfi._numberGroupSizes;
1760 nfi._percentGroupSeparator = nfi._numberGroupSeparator;
1761 if (string.IsNullOrEmpty(nfi._positiveSign))
1762 {
1763 nfi._positiveSign = "+";
1764 }
1765 if (string.IsNullOrEmpty(nfi._currencyDecimalSeparator))
1766 {
1767 nfi._currencyDecimalSeparator = nfi._numberDecimalSeparator;
1768 }
1769 }
1770
1771 internal static string AnsiToLower(string testString)
1772 {
1774 }
1775
1777 {
1779 {
1780 return 0;
1781 }
1783 {
1784 return IcuGetLocaleInfo(type);
1785 }
1786 return NlsGetLocaleInfo(type);
1787 }
1788
1790 {
1792 {
1793 return 0;
1794 }
1796 {
1797 return IcuGetLocaleInfo(type);
1798 }
1799 return NlsGetLocaleInfo(type);
1800 }
1801
1803 {
1805 {
1806 return null;
1807 }
1809 {
1810 return IcuGetLocaleInfo(type);
1811 }
1812 return NlsGetLocaleInfo(type);
1813 }
1814
1816 {
1818 {
1819 return null;
1820 }
1822 {
1824 }
1825 return NlsGetLocaleInfo(type);
1826 }
1827
1828 private string GetLocaleInfoCore(string localeName, LocaleStringData type, string uiCultureName = null)
1829 {
1831 {
1832 return null;
1833 }
1835 {
1837 }
1839 }
1840
1842 {
1844 {
1845 return null;
1846 }
1848 {
1849 return IcuGetLocaleInfo(type);
1850 }
1851 return NlsGetLocaleInfo(type);
1852 }
1853
1855 {
1856 string text = _sRealName;
1858 {
1859 return false;
1860 }
1862 if (indexOfUnderscore > 0)
1863 {
1864 readOnlySpan = text.AsSpan(indexOfUnderscore + 1);
1865 text = string.Concat(text.AsSpan(0, indexOfUnderscore), "@collation=", readOnlySpan);
1866 }
1868 {
1869 return false;
1870 }
1871 indexOfUnderscore = _sWindowsName.IndexOf("@collation=", StringComparison.Ordinal);
1872 if (indexOfUnderscore >= 0)
1873 {
1874 _sName = string.Concat(_sWindowsName.AsSpan(0, indexOfUnderscore), "_", readOnlySpan);
1875 }
1876 else
1877 {
1879 }
1881 _iLanguage = LCID;
1882 if (_iLanguage == 0)
1883 {
1884 _iLanguage = 4096;
1885 }
1886 _bNeutral = TwoLetterISOCountryName.Length == 0;
1889 {
1890 _sName = _sWindowsName.Substring(0, indexOfUnderscore);
1891 }
1892 return true;
1893 }
1894
1895 internal unsafe static bool GetLocaleName(string localeName, out string windowsName)
1896 {
1897 char* value = stackalloc char[157];
1899 {
1900 windowsName = null;
1901 return false;
1902 }
1903 windowsName = new string(value);
1904 return true;
1905 }
1906
1908 {
1910 }
1911
1912 private unsafe string IcuGetLocaleInfo(string localeName, LocaleStringData type, string uiCultureName = null)
1913 {
1914 if (type == LocaleStringData.NegativeInfinitySymbol)
1915 {
1916 return IcuGetLocaleInfo(localeName, LocaleStringData.NegativeSign) + IcuGetLocaleInfo(localeName, LocaleStringData.PositiveInfinitySymbol);
1917 }
1918 char* value = stackalloc char[100];
1920 {
1921 return string.Empty;
1922 }
1923 return new string(value);
1924 }
1925
1927 {
1928 if (type == LocaleNumberData.CalendarType)
1929 {
1930 return 0;
1931 }
1932 int value = 0;
1934 return value;
1935 }
1936
1938 {
1939 int primaryGroupSize = 0;
1940 int secondaryGroupSize = 0;
1942 if (secondaryGroupSize != 0)
1943 {
1944 return new int[2] { primaryGroupSize, secondaryGroupSize };
1945 }
1946 return new int[1] { primaryGroupSize };
1947 }
1948
1949 private string IcuGetTimeFormatString()
1950 {
1951 return IcuGetTimeFormatString(shortFormat: false);
1952 }
1953
1954 private unsafe string IcuGetTimeFormatString(bool shortFormat)
1955 {
1956 char* ptr = stackalloc char[100];
1958 {
1959 return string.Empty;
1960 }
1962 return ConvertIcuTimeFormatString(span.Slice(0, span.IndexOf('\0')));
1963 }
1964
1965 private static CultureData IcuGetCultureDataFromRegionName(string regionName)
1966 {
1967 return null;
1968 }
1969
1970 private string IcuGetLanguageDisplayName(string cultureName)
1971 {
1972 return IcuGetLocaleInfo(cultureName, LocaleStringData.LocalizedDisplayName, CultureInfo.CurrentUICulture.Name);
1973 }
1974
1975 private static string IcuGetRegionDisplayName()
1976 {
1977 return null;
1978 }
1979
1980 internal static bool IcuIsEnsurePredefinedLocaleName(string name)
1981 {
1983 }
1984
1986 {
1987 Span<char> span = stackalloc char[157];
1988 bool flag = false;
1989 int length = 0;
1990 for (int i = 0; i < icuFormatString.Length; i++)
1991 {
1992 switch (icuFormatString[i])
1993 {
1994 case '\'':
1995 span[length++] = icuFormatString[i++];
1996 for (; i < icuFormatString.Length; i++)
1997 {
1998 char c = icuFormatString[i];
1999 span[length++] = c;
2000 if (c == '\'')
2001 {
2002 break;
2003 }
2004 }
2005 break;
2006 case '.':
2007 case ':':
2008 case 'H':
2009 case 'h':
2010 case 'm':
2011 case 's':
2012 span[length++] = icuFormatString[i];
2013 break;
2014 case ' ':
2015 case '\u00a0':
2016 span[length++] = ' ';
2017 break;
2018 case 'a':
2019 if (!flag)
2020 {
2021 flag = true;
2022 span[length++] = 't';
2023 span[length++] = 't';
2024 }
2025 break;
2026 }
2027 }
2028 return span.Slice(0, length).ToString();
2029 }
2030
2031 private static int IcuLocaleNameToLCID(string cultureName)
2032 {
2034 if (localeDataNumericPart != -1)
2035 {
2036 return localeDataNumericPart;
2037 }
2038 return 4096;
2039 }
2040
2041 private static int IcuGetGeoId(string cultureName)
2042 {
2044 if (localeDataNumericPart != -1)
2045 {
2046 return localeDataNumericPart;
2047 }
2048 return Invariant.GeoId;
2049 }
2050
2051 private static int IcuGetDigitSubstitution(string cultureName)
2052 {
2053 int localeDataNumericPart = IcuLocaleData.GetLocaleDataNumericPart(cultureName, IcuLocaleDataParts.DigitSubstitutionOrListSeparator);
2054 if (localeDataNumericPart != -1)
2055 {
2056 return (int)((long)localeDataNumericPart & 0xFFFFL);
2057 }
2058 return 1;
2059 }
2060
2061 private static string IcuGetListSeparator(string cultureName)
2062 {
2063 int localeDataNumericPart = IcuLocaleData.GetLocaleDataNumericPart(cultureName, IcuLocaleDataParts.DigitSubstitutionOrListSeparator);
2064 if (localeDataNumericPart != -1)
2065 {
2067 {
2068 case 0L:
2069 return ",";
2070 case 65536L:
2071 return ";";
2072 case 131072L:
2073 return "،";
2074 case 196608L:
2075 return "Ø›";
2076 case 262144L:
2077 return ",,";
2078 }
2079 }
2080 return ",";
2081 }
2082
2083 private static string IcuGetThreeLetterWindowsLanguageName(string cultureName)
2084 {
2085 return IcuLocaleData.GetThreeLetterWindowsLanguageName(cultureName) ?? "ZZZ";
2086 }
2087
2089 {
2090 if ((types & (CultureTypes.NeutralCultures | CultureTypes.SpecificCultures)) == 0)
2091 {
2092 return Array.Empty<CultureInfo>();
2093 }
2094 int locales = Interop.Globalization.GetLocales(null, 0);
2095 if (locales <= 0)
2096 {
2097 return Array.Empty<CultureInfo>();
2098 }
2099 char[] array = new char[locales];
2101 if (locales <= 0)
2102 {
2103 return Array.Empty<CultureInfo>();
2104 }
2105 bool flag = (types & CultureTypes.NeutralCultures) != 0;
2106 bool flag2 = (types & CultureTypes.SpecificCultures) != 0;
2108 if (flag)
2109 {
2111 }
2112 int num;
2113 for (int i = 0; i < locales; i += num)
2114 {
2115 num = array[i++];
2116 if (i + num <= locales)
2117 {
2119 if ((flag && cultureInfo.IsNeutralCulture) || (flag2 && !cultureInfo.IsNeutralCulture))
2120 {
2121 list.Add(cultureInfo);
2122 }
2123 }
2124 }
2125 return list.ToArray();
2126 }
2127
2128 private static string IcuGetConsoleFallbackName(string cultureName)
2129 {
2130 return IcuLocaleData.GetConsoleUICulture(cultureName);
2131 }
2132
2133 private static bool IsValidCultureName(string subject, out int indexOfUnderscore)
2134 {
2135 indexOfUnderscore = -1;
2136 if (subject.Length == 0)
2137 {
2138 return true;
2139 }
2140 if (subject.Length == 1 || subject.Length > 85)
2141 {
2142 return false;
2143 }
2144 bool flag = false;
2145 for (int i = 0; i < subject.Length; i++)
2146 {
2147 char c = subject[i];
2148 switch (c)
2149 {
2150 case '-':
2151 case '_':
2152 if (i == 0 || i == subject.Length - 1)
2153 {
2154 return false;
2155 }
2156 if (subject[i - 1] == '_' || subject[i - 1] == '-')
2157 {
2158 return false;
2159 }
2160 if (c == '_')
2161 {
2162 if (flag)
2163 {
2164 return false;
2165 }
2166 flag = true;
2168 }
2169 break;
2170 default:
2171 return false;
2172 case '\0':
2173 case '0':
2174 case '1':
2175 case '2':
2176 case '3':
2177 case '4':
2178 case '5':
2179 case '6':
2180 case '7':
2181 case '8':
2182 case '9':
2183 case 'A':
2184 case 'B':
2185 case 'C':
2186 case 'D':
2187 case 'E':
2188 case 'F':
2189 case 'G':
2190 case 'H':
2191 case 'I':
2192 case 'J':
2193 case 'K':
2194 case 'L':
2195 case 'M':
2196 case 'N':
2197 case 'O':
2198 case 'P':
2199 case 'Q':
2200 case 'R':
2201 case 'S':
2202 case 'T':
2203 case 'U':
2204 case 'V':
2205 case 'W':
2206 case 'X':
2207 case 'Y':
2208 case 'Z':
2209 case 'a':
2210 case 'b':
2211 case 'c':
2212 case 'd':
2213 case 'e':
2214 case 'f':
2215 case 'g':
2216 case 'h':
2217 case 'i':
2218 case 'j':
2219 case 'k':
2220 case 'l':
2221 case 'm':
2222 case 'n':
2223 case 'o':
2224 case 'p':
2225 case 'q':
2226 case 'r':
2227 case 's':
2228 case 't':
2229 case 'u':
2230 case 'v':
2231 case 'w':
2232 case 'x':
2233 case 'y':
2234 case 'z':
2235 break;
2236 }
2237 }
2238 return true;
2239 }
2240
2241 internal unsafe static string GetLocaleInfoEx(string localeName, uint field)
2242 {
2243 char* ptr = stackalloc char[530];
2245 if (localeInfoEx > 0)
2246 {
2247 return new string(ptr);
2248 }
2249 return null;
2250 }
2251
2252 internal unsafe static int GetLocaleInfoExInt(string localeName, uint field)
2253 {
2254 field |= 0x20000000u;
2255 int result = 0;
2256 GetLocaleInfoEx(localeName, field, (char*)(&result), 4);
2257 return result;
2258 }
2259
2260 internal unsafe static int GetLocaleInfoEx(string lpLocaleName, uint lcType, char* lpLCData, int cchData)
2261 {
2263 }
2264
2266 {
2268 }
2269
2271 {
2273 }
2274
2276 {
2277 uint num = (uint)type;
2278 if (!_bUseOverrides)
2279 {
2280 num |= 0x80000000u;
2281 }
2282 return GetLocaleInfoExInt(_sWindowsName, num);
2283 }
2284
2289
2290 internal static bool NlsIsEnsurePredefinedLocaleName(string name)
2291 {
2292 return GetLocaleInfoExInt(name, 125u) != 1;
2293 }
2294
2299
2305
2306 private unsafe static CultureData NlsGetCultureDataFromRegionName(string regionName)
2307 {
2309 value.cultureName = null;
2310 value.regionName = regionName;
2312 if (value.cultureName != null)
2313 {
2314 return GetCultureData(value.cultureName, useUserOverride: true);
2315 }
2316 return null;
2317 }
2318
2319 private string NlsGetLanguageDisplayName(string cultureName)
2320 {
2323 {
2324 return NativeName;
2325 }
2326 return NlsGetLocaleInfo(cultureName, LocaleStringData.LocalizedDisplayName);
2327 }
2328
2330 {
2332 {
2333 return NlsGetLocaleInfo(LocaleStringData.LocalizedCountryName);
2334 }
2335 return NativeCountryName;
2336 }
2337
2338 private static string GetLocaleInfoFromLCType(string localeName, uint lctype, bool useUserOverride)
2339 {
2340 if (!useUserOverride)
2341 {
2342 lctype |= 0x80000000u;
2343 }
2344 return GetLocaleInfoEx(localeName, lctype) ?? string.Empty;
2345 }
2346
2347 [return: NotNullIfNotNull("str")]
2348 internal static string ReescapeWin32String(string str)
2349 {
2350 if (str == null)
2351 {
2352 return null;
2353 }
2355 bool flag = false;
2356 for (int i = 0; i < str.Length; i++)
2357 {
2358 if (str[i] == '\'')
2359 {
2360 if (flag)
2361 {
2362 if (i + 1 < str.Length && str[i + 1] == '\'')
2363 {
2364 if (stringBuilder == null)
2365 {
2366 stringBuilder = new StringBuilder(str, 0, i, str.Length * 2);
2367 }
2368 stringBuilder.Append("\\'");
2369 i++;
2370 continue;
2371 }
2372 flag = false;
2373 }
2374 else
2375 {
2376 flag = true;
2377 }
2378 }
2379 else if (str[i] == '\\')
2380 {
2381 if (stringBuilder == null)
2382 {
2383 stringBuilder = new StringBuilder(str, 0, i, str.Length * 2);
2384 }
2385 stringBuilder.Append("\\\\");
2386 continue;
2387 }
2388 stringBuilder?.Append(str[i]);
2389 }
2390 if (stringBuilder == null)
2391 {
2392 return str;
2393 }
2394 return stringBuilder.ToString();
2395 }
2396
2397 [return: NotNullIfNotNull("array")]
2398 internal static string[] ReescapeWin32Strings(string[] array)
2399 {
2400 if (array != null)
2401 {
2402 for (int i = 0; i < array.Length; i++)
2403 {
2405 }
2406 }
2407 return array;
2408 }
2409
2410 private static int[] ConvertWin32GroupString(string win32Str)
2411 {
2412 if (string.IsNullOrEmpty(win32Str))
2413 {
2414 return new int[1] { 3 };
2415 }
2416 if (win32Str[0] == '0')
2417 {
2418 return new int[1];
2419 }
2420 int[] array;
2421 if (win32Str[^1] == '0')
2422 {
2423 array = new int[win32Str.Length / 2];
2424 }
2425 else
2426 {
2427 array = new int[win32Str.Length / 2 + 2];
2428 array[^1] = 0;
2429 }
2430 int num = 0;
2431 int num2 = 0;
2432 while (num < win32Str.Length && num2 < array.Length)
2433 {
2434 if (win32Str[num] < '1' || win32Str[num] > '9')
2435 {
2436 return new int[1] { 3 };
2437 }
2438 array[num2] = win32Str[num] - 48;
2439 num += 2;
2440 num2++;
2441 }
2442 return array;
2443 }
2444
2445 private static int ConvertFirstDayOfWeekMonToSun(int iTemp)
2446 {
2447 iTemp++;
2448 if (iTemp > 6)
2449 {
2450 iTemp = 0;
2451 }
2452 return iTemp;
2453 }
2454
2456 private unsafe static Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
2457 {
2459 try
2460 {
2461 string text = new string(lpLocaleString);
2462 string localeInfoEx = GetLocaleInfoEx(text, 90u);
2463 if (localeInfoEx != null && localeInfoEx.Equals(reference.regionName, StringComparison.OrdinalIgnoreCase))
2464 {
2465 reference.cultureName = text;
2466 return Interop.BOOL.FALSE;
2467 }
2468 return Interop.BOOL.TRUE;
2469 }
2470 catch (Exception)
2471 {
2472 return Interop.BOOL.FALSE;
2473 }
2474 }
2475
2477 private unsafe static Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle)
2478 {
2480 try
2481 {
2482 reference.strings.Add(new string(lpLocaleString));
2483 return Interop.BOOL.TRUE;
2484 }
2485 catch (Exception)
2486 {
2487 return Interop.BOOL.FALSE;
2488 }
2489 }
2490
2492 private unsafe static Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam)
2493 {
2494 ref EnumData reference = ref Unsafe.As<byte, EnumData>(ref *(byte*)lParam);
2495 try
2496 {
2497 reference.strings.Add(new string(lpTimeFormatString));
2498 return Interop.BOOL.TRUE;
2499 }
2500 catch (Exception)
2501 {
2502 return Interop.BOOL.FALSE;
2503 }
2504 }
2505
2506 private unsafe static string[] nativeEnumTimeFormats(string localeName, uint dwFlags, bool useUserOverride)
2507 {
2508 EnumData value = default(EnumData);
2509 value.strings = new List<string>();
2511 if (value.strings.Count > 0)
2512 {
2513 string[] array = value.strings.ToArray();
2514 if (!useUserOverride && value.strings.Count > 1)
2515 {
2516 uint lctype = ((dwFlags == 2) ? 121u : 4099u);
2518 if (localeInfoFromLCType != "")
2519 {
2520 string text = array[0];
2522 {
2523 array[0] = array[1];
2524 array[1] = text;
2525 }
2526 }
2527 }
2528 return array;
2529 }
2530 return null;
2531 }
2532
2533 private static int NlsLocaleNameToLCID(string cultureName)
2534 {
2535 return Interop.Kernel32.LocaleNameToLCID(cultureName, 134217728u);
2536 }
2537
2538 private string NlsGetThreeLetterWindowsLanguageName(string cultureName)
2539 {
2540 return NlsGetLocaleInfo(cultureName, LocaleStringData.AbbreviatedWindowsLanguageName);
2541 }
2542
2544 {
2545 uint num = 0u;
2546 if ((types & (CultureTypes.InstalledWin32Cultures | CultureTypes.ReplacementCultures | CultureTypes.FrameworkCultures)) != 0)
2547 {
2548 num |= 0x30u;
2549 }
2550 if ((types & CultureTypes.NeutralCultures) != 0)
2551 {
2552 num |= 0x10u;
2553 }
2554 if ((types & CultureTypes.SpecificCultures) != 0)
2555 {
2556 num |= 0x20u;
2557 }
2558 if ((types & CultureTypes.UserCustomCulture) != 0)
2559 {
2560 num |= 2u;
2561 }
2562 if ((types & CultureTypes.ReplacementCultures) != 0)
2563 {
2564 num |= 2u;
2565 }
2566 EnumData value = default(EnumData);
2567 value.strings = new List<string>();
2569 CultureInfo[] array = new CultureInfo[value.strings.Count];
2570 for (int i = 0; i < array.Length; i++)
2571 {
2572 array[i] = new CultureInfo(value.strings[i]);
2573 }
2574 return array;
2575 }
2576
2577 private string NlsGetConsoleFallbackName(string cultureName)
2578 {
2579 return NlsGetLocaleInfo(cultureName, LocaleStringData.ConsoleFallbackName);
2580 }
2581
2582 private unsafe bool InitCultureDataCore()
2583 {
2584 char* ptr = stackalloc char[85];
2586 {
2588 {
2589 return GetLocaleInfoEx(_sRealName, 92u, ptr, 85) != 0;
2590 }
2591 return false;
2592 }
2593 string sRealName = _sRealName;
2595 if (localeInfoEx == 0)
2596 {
2597 return false;
2598 }
2599 _sRealName = new string(ptr, 0, localeInfoEx - 1);
2601 if (GetLocaleInfoEx(sRealName, 536871025u, ptr, 2) == 0)
2602 {
2603 return false;
2604 }
2605 _bNeutral = *(uint*)ptr != 0;
2607 if (_bNeutral)
2608 {
2609 _sName = sRealName;
2611 if (localeInfoEx < 1)
2612 {
2613 return false;
2614 }
2616 }
2617 else
2618 {
2620 _sName = sRealName;
2621 if (GetLocaleInfoEx(sRealName, 536870913u, ptr, 2) == 0)
2622 {
2623 return false;
2624 }
2625 _iLanguage = *(int*)ptr;
2627 {
2628 int num = sRealName.IndexOf('_');
2629 if (num > 0)
2630 {
2631 _sName = sRealName.Substring(0, num);
2632 }
2633 }
2634 }
2635 return true;
2636 }
2637
2642
2643 internal unsafe static CultureData GetCurrentRegionData()
2644 {
2645 Span<char> span = stackalloc char[10];
2647 if (userGeoID != -1)
2648 {
2649 int geoInfo;
2650 fixed (char* lpGeoData = span)
2651 {
2653 }
2654 if (geoInfo != 0)
2655 {
2656 geoInfo -= ((span[geoInfo - 1] == '\0') ? 1 : 0);
2658 if (cultureDataForRegion != null)
2659 {
2660 return cultureDataForRegion;
2661 }
2662 }
2663 }
2664 return CultureInfo.CurrentCulture._cultureData;
2665 }
2666
2667 private unsafe static string LCIDToLocaleName(int culture)
2668 {
2669 char* ptr = stackalloc char[86];
2670 int num = Interop.Kernel32.LCIDToLocaleName(culture, ptr, 86, 134217728u);
2671 if (num > 0)
2672 {
2673 return new string(ptr);
2674 }
2675 return null;
2676 }
2677
2678 private string[] GetTimeFormatsCore(bool shortFormat)
2679 {
2681 {
2683 }
2685 if (_bUseOverrides)
2686 {
2689 {
2690 return new string[2] { localeInfoFromLCType, text };
2691 }
2692 return new string[1] { localeInfoFromLCType };
2693 }
2694 return new string[1] { text };
2695 }
2696
2697 private int GetAnsiCodePage(string cultureName)
2698 {
2699 return NlsGetLocaleInfo(LocaleNumberData.AnsiCodePage);
2700 }
2701
2702 private int GetOemCodePage(string cultureName)
2703 {
2704 return NlsGetLocaleInfo(LocaleNumberData.OemCodePage);
2705 }
2706
2707 private int GetMacCodePage(string cultureName)
2708 {
2709 return NlsGetLocaleInfo(LocaleNumberData.MacCodePage);
2710 }
2711
2712 private int GetEbcdicCodePage(string cultureName)
2713 {
2714 return NlsGetLocaleInfo(LocaleNumberData.EbcdicCodePage);
2715 }
2716}
static bool IsPredefinedLocale(string localeName)
static unsafe bool GetLocaleName(string localeName, char *value, int valueLength)
static unsafe bool GetLocaleTimeFormat(string localeName, bool shortFormat, char *value, int valueLength)
static unsafe bool GetLocaleInfoString(string localeName, uint localeStringData, char *value, int valueLength, string uiLocaleName=null)
static bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value)
static int GetLocales([Out] char[] value, int valueLength)
static bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize)
static unsafe int ResolveLocaleName(string lpNameToResolve, char *lpLocaleName, int cchLocaleName)
static unsafe bool EnumSystemLocalesEx(delegate *unmanaged< char *, uint, void *, BOOL > lpLocaleEnumProcEx, uint dwFlags, void *lParam, IntPtr reserved)
static int LocaleNameToLCID(string lpName, uint dwFlags)
static unsafe int GetGeoInfo(int location, int geoType, char *lpGeoData, int cchData, int LangId)
static unsafe int LCIDToLocaleName(int locale, char *pLocaleName, int cchName, uint dwFlags)
static int GetUserGeoID(int geoClass)
static unsafe int GetLocaleInfoEx(string lpLocaleName, uint LCType, void *lpLCData, int cchData)
static unsafe bool EnumTimeFormatsEx(delegate *unmanaged< char *, void *, BOOL > lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void *lParam)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static int GetCalendarsCore(string localeName, bool useUserOverride, CalendarId[] calendars)
static readonly CalendarData Invariant
string GetLocaleInfoCore(string localeName, LocaleStringData type, string uiCultureName=null)
static string GetDateSeparator(string format)
string NlsGetLanguageDisplayName(string cultureName)
static volatile Dictionary< string, string > s_regionNames
static CultureInfo[] GetCultures(CultureTypes types)
int IcuGetLocaleInfo(LocaleNumberData type)
int[] GetLocaleInfoCoreUserOverride(LocaleGroupingData type)
int GetOemCodePage(string cultureName)
static int[] ConvertWin32GroupString(string win32Str)
static bool NlsIsEnsurePredefinedLocaleName(string name)
string[] AbbreviatedMonthNames(CalendarId calendarId)
static volatile Dictionary< string, CultureData > s_cachedCultures
static volatile Dictionary< string, CultureData > s_cachedRegions
string IcuGetLanguageDisplayName(string cultureName)
int GetLocaleInfoCore(LocaleNumberData type)
static int NlsLocaleNameToLCID(string cultureName)
static int GetIndexOfNextTokenAfterSeconds(string time, int index, out bool containsSpace)
CalendarData GetCalendar(CalendarId calendarId)
string NlsGetLocaleInfo(LocaleStringData type)
static unsafe Interop.BOOL EnumSystemLocalesProc(char *lpLocaleString, uint flags, void *contextHandle)
string GetLocaleInfoCore(LocaleStringData type, string uiCultureName=null)
static unsafe Interop.BOOL EnumTimeCallback(char *lpTimeFormatString, void *lParam)
static unsafe CultureData NlsGetCultureDataFromRegionName(string regionName)
int GetMacCodePage(string cultureName)
string CalendarName(CalendarId calendarId)
string[] YearMonths(CalendarId calendarId)
string NlsGetThreeLetterWindowsLanguageName(string cultureName)
string GetLanguageDisplayNameCore(string cultureName)
int GetEbcdicCodePage(string cultureName)
static unsafe bool GetLocaleName(string localeName, out string windowsName)
static Dictionary< string, string > RegionNames
static CultureData CreateCultureData(string cultureName, bool useUserOverride)
static bool IsValidCultureName(string subject, out int indexOfUnderscore)
string[] DayNames(CalendarId calendarId)
static int IcuLocaleNameToLCID(string cultureName)
int NlsGetLocaleInfo(LocaleNumberData type)
string[] ShortDates(CalendarId calendarId)
static string AnsiToLower(string testString)
string[] AbbrevEraNames(CalendarId calendarId)
static string ConvertIcuTimeFormatString(ReadOnlySpan< char > icuFormatString)
static string StripSecondsFromPattern(string time)
static int IcuGetDigitSubstitution(string cultureName)
static bool IsCustomCultureId(int cultureId)
static volatile CultureData s_Invariant
string NlsGetConsoleFallbackName(string cultureName)
static string NormalizeCultureName(string name, out bool isNeutralName)
static CultureData CreateCultureWithInvariantData()
void InitUserOverride(bool useUserOverride)
string GetLocaleInfoCoreUserOverride(LocaleStringData type)
static string GetTimeSeparator(string format)
static int IcuGetGeoId(string cultureName)
static CultureData GetCultureData(string cultureName, bool useUserOverride)
static string UnescapeNlsString(string str, int start, int end)
string[] GetTimeFormatsCore(bool shortFormat)
static string IcuGetConsoleFallbackName(string cultureName)
static string[] ReescapeWin32Strings(string[] array)
string DateSeparator(CalendarId calendarId)
int GetAnsiCodePage(string cultureName)
string[] AbbreviatedGenitiveMonthNames(CalendarId calendarId)
static string IcuGetRegionDisplayName()
static string GetLocaleInfoFromLCType(string localeName, uint lctype, bool useUserOverride)
static unsafe int GetLocaleInfoEx(string lpLocaleName, uint lcType, char *lpLCData, int cchData)
string MonthDay(CalendarId calendarId)
static int ConvertFirstDayOfWeekMonToSun(int iTemp)
unsafe string IcuGetTimeFormatString(bool shortFormat)
static unsafe Interop.BOOL EnumAllSystemLocalesProc(char *lpLocaleString, uint flags, void *contextHandle)
volatile string[] _saDurationFormats
static string IcuGetListSeparator(string cultureName)
static string GetSeparator(string format, string timeParts)
static bool IcuIsEnsurePredefinedLocaleName(string name)
int[] IcuGetLocaleInfo(LocaleGroupingData type)
static unsafe CultureInfo[] NlsEnumCultures(CultureTypes types)
static int IndexOfTimePart(string format, int startIndex, string timeParts)
static CultureData IcuGetCultureDataFromRegionName(string regionName)
string[] AbbreviatedDayNames(CalendarId calendarId)
static unsafe string GetLocaleInfoEx(string localeName, uint field)
volatile CalendarId[] _waCalendars
static string IcuGetThreeLetterWindowsLanguageName(string cultureName)
static CultureInfo[] IcuEnumCultures(CultureTypes types)
string IcuGetLocaleInfo(LocaleStringData type, string uiCultureName=null)
string[] LongDates(CalendarId calendarId)
int[] NlsGetLocaleInfo(LocaleGroupingData type)
string[] AbbreviatedEnglishEraNames(CalendarId calendarId)
void GetNFIValues(NumberFormatInfo nfi)
string[] LeapYearMonthNames(CalendarId calendarId)
int GetLocaleInfoCoreUserOverride(LocaleNumberData type)
unsafe string IcuGetLocaleInfo(string localeName, LocaleStringData type, string uiCultureName=null)
string[] GenitiveMonthNames(CalendarId calendarId)
string[] EraNames(CalendarId calendarId)
static CultureData GetCultureData(int culture, bool bUseUserOverride)
static unsafe int GetLocaleInfoExInt(string localeName, uint field)
string NlsGetLocaleInfo(string localeName, LocaleStringData type)
static string ReescapeWin32String(string str)
string[] SuperShortDayNames(CalendarId calendarId)
static CultureData GetCultureDataForRegion(string cultureName, bool useUserOverride)
static readonly object s_lock
static unsafe string LCIDToLocaleName(int culture)
string[] MonthNames(CalendarId calendarId)
static unsafe string[] nativeEnumTimeFormats(string localeName, uint dwFlags, bool useUserOverride)
static unsafe CultureData GetCurrentRegionData()
static bool VerifyCultureName(string cultureName, bool throwException)
static CultureInfo CurrentUICulture
static Calendar GetCalendarInstance(CalendarId calType)
static CultureInfo UserDefaultUICulture
static CultureInfo CurrentCulture
static ? string UserDefaultLocaleName
static CultureInfo InvariantCulture
static CultureInfo GetUserDefaultCulture()
static CultureInfo GetCultureInfo(int culture)
static ? CultureInfo DefaultThreadCurrentUICulture
static string GetSpecificCultureName(string cultureName)
static string GetThreeLetterWindowsLanguageName(string cultureName)
static int GetLocaleDataNumericPart(string cultureName, IcuLocaleDataParts part)
static string GetConsoleUICulture(string cultureName)
static unsafe string ToLowerAsciiInvariant(string s)
Definition TextInfo.cs:371
static string ArgumentOutOfRange_Range
Definition SR.cs:1096
static string Argument_InvalidId
Definition SR.cs:698
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_CultureNotSupportedInInvariantMode
Definition SR.cs:550
static string Argument_CultureNotSupported
Definition SR.cs:548
Definition SR.cs:7
static StringComparer OrdinalIgnoreCase
static readonly IntPtr Zero
Definition IntPtr.cs:18