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

Commit 29ecd4c

Browse files
committed
Remove C++ Locale use in EnumSymbols
1 parent c4861cc commit 29ecd4c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/corefx/System.Globalization.Native/calendarData.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,14 @@ bool EnumSymbols(Locale& locale,
408408
if (U_FAILURE(err))
409409
return false;
410410

411-
Locale localeWithCalendar(locale);
412-
localeWithCalendar.setKeywordValue("calendar", GetCalendarName(calendarId), err);
411+
char localeWithCalendarName[ULOC_FULLNAME_CAPACITY];
412+
strncpy(localeWithCalendarName, locale.getName(), ULOC_FULLNAME_CAPACITY);
413+
uloc_setKeywordValue("calendar", GetCalendarName(calendarId), localeWithCalendarName, ULOC_FULLNAME_CAPACITY, &err);
413414

414415
if (U_FAILURE(err))
415416
return false;
416417

417-
UCalendar* pCalendar = ucal_open(nullptr, 0, localeWithCalendar.getName(), UCAL_DEFAULT, &err);
418+
UCalendar* pCalendar = ucal_open(nullptr, 0, localeWithCalendarName, UCAL_DEFAULT, &err);
418419
UCalendarHolder calenderHolder(pCalendar, err);
419420

420421
if (U_FAILURE(err))

0 commit comments

Comments
 (0)