* In CalendarData.CheckSpecialCalendar() when the calendar ID is GREGORIAN_US CallGetCalendarInfoEx() was being called twice even if the first call succeeded.
* Update src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Keith Newton <anony@mous.com>
Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
{
// Failed, set it to a locale (fa-IR) that's alway has Gregorian US available in the OS
localeName = "fa-IR";
- }
- // See if that works
- if (!CallGetCalendarInfoEx(localeName, calendar, CAL_SCALNAME, out string _))
- {
- // Failed again, just use en-US with the gregorian calendar
- localeName = "en-US";
- calendar = CalendarId.GREGORIAN;
+
+ // See if that works
+ if (!CallGetCalendarInfoEx(localeName, calendar, CAL_SCALNAME, out string _))
+ {
+ // Failed again, just use en-US with the gregorian calendar
+ localeName = "en-US";
+ calendar = CalendarId.GREGORIAN;
+ }
}
break;
case CalendarId.TAIWAN: