@@ -469,8 +469,8 @@ void MessageFormatter::resolvePreferences(MessageContext& context, UVector& res,
469469 if (!key.isWildcard ()) {
470470 // 2ii(b)(a) Assert that key is a literal.
471471 // (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 () );
474474 // 2ii(b)(c) Append `ks` as the last element of the list `keys`.
475475 ksP.adoptInstead (create<UnicodeString>(std::move (ks), status));
476476 CHECK_ERROR (status);
@@ -531,7 +531,7 @@ void MessageFormatter::filterVariants(const UVector& pref, UVector& vars, UError
531531 // 2i(c). Assert that `key` is a literal.
532532 // (Not needed)
533533 // 2i(d). Let `ks` be the resolved value of `key`.
534- UnicodeString ks = key.asLiteral ().unquoted ();
534+ UnicodeString ks = normalizeNFC ( key.asLiteral ().unquoted () );
535535 // 2i(e). Let `matches` be the list of strings at index `i` of `pref`.
536536 const UVector& matches = *(static_cast <UVector*>(pref[i])); // `matches` is a vector of strings
537537 // 2i(f). If `matches` includes `ks`
@@ -593,7 +593,7 @@ void MessageFormatter::sortVariants(const UVector& pref, UVector& vars, UErrorCo
593593 // 5iii(c)(a). Assert that `key` is a literal.
594594 // (Not needed)
595595 // 5iii(c)(b). Let `ks` be the resolved value of `key`.
596- UnicodeString ks = key.asLiteral ().unquoted ();
596+ UnicodeString ks = normalizeNFC ( key.asLiteral ().unquoted () );
597597 // 5iii(c)(c) Let matchpref be the integer position of ks in `matches`.
598598 matchpref = vectorFind (matches, ks);
599599 U_ASSERT (matchpref >= 0 );
0 commit comments