@@ -469,8 +469,8 @@ void MessageFormatter::resolvePreferences(MessageContext& context, UVector& res,
469
469
if (!key.isWildcard ()) {
470
470
// 2ii(b)(a) Assert that key is a literal.
471
471
// (Not needed)
472
- // 2ii(b)(b) Let `ks` be the resolved value of `key`.
473
- ks = key.asLiteral ().unquoted ();
472
+ // 2ii(b)(b) Let `ks` be the resolved value of `key` in Unicode Normalization Form C .
473
+ ks = normalizeNFC ( key.asLiteral ().unquoted () );
474
474
// 2ii(b)(c) Append `ks` as the last element of the list `keys`.
475
475
ksP.adoptInstead (create<UnicodeString>(std::move (ks), status));
476
476
CHECK_ERROR (status);
@@ -531,7 +531,7 @@ void MessageFormatter::filterVariants(const UVector& pref, UVector& vars, UError
531
531
// 2i(c). Assert that `key` is a literal.
532
532
// (Not needed)
533
533
// 2i(d). Let `ks` be the resolved value of `key`.
534
- UnicodeString ks = key.asLiteral ().unquoted ();
534
+ UnicodeString ks = normalizeNFC ( key.asLiteral ().unquoted () );
535
535
// 2i(e). Let `matches` be the list of strings at index `i` of `pref`.
536
536
const UVector& matches = *(static_cast <UVector*>(pref[i])); // `matches` is a vector of strings
537
537
// 2i(f). If `matches` includes `ks`
@@ -593,7 +593,7 @@ void MessageFormatter::sortVariants(const UVector& pref, UVector& vars, UErrorCo
593
593
// 5iii(c)(a). Assert that `key` is a literal.
594
594
// (Not needed)
595
595
// 5iii(c)(b). Let `ks` be the resolved value of `key`.
596
- UnicodeString ks = key.asLiteral ().unquoted ();
596
+ UnicodeString ks = normalizeNFC ( key.asLiteral ().unquoted () );
597
597
// 5iii(c)(c) Let matchpref be the integer position of ks in `matches`.
598
598
matchpref = vectorFind (matches, ks);
599
599
U_ASSERT (matchpref >= 0 );
0 commit comments