From 2e8d3954ef2e4aebb9961d1e62637c89408de326 Mon Sep 17 00:00:00 2001 From: Alexander David Frick Date: Wed, 25 Jan 2023 02:38:33 -0600 Subject: [PATCH] Update js-display-names.cc --- src/v8/src/objects/js-display-names.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/v8/src/objects/js-display-names.cc b/src/v8/src/objects/js-display-names.cc index 15c0b848..18024f24 100644 --- a/src/v8/src/objects/js-display-names.cc +++ b/src/v8/src/objects/js-display-names.cc @@ -133,7 +133,9 @@ class LanguageNames : public LocaleDisplayNamesCommon { // 1.b If IsStructurallyValidLanguageTag(code) is false, throw a RangeError // exception. icu::Locale l = - icu::Locale::createCanonical(icu::Locale::forLanguageTag(code, status).getBaseName()); + icu::Locale(icu::Locale::forLanguageTag(code, status).getBaseName()); + // 1.c Set code to CanonicalizeUnicodeLocaleId(code). + l.canonicalize(status); std::string checked = l.toLanguageTag(status); if (U_FAILURE(status)) {