8000 Apply NFC normalization during :string key comparison (#905) · unicode-org/message-format-wg@a93fcc1 · GitHub
[go: up one dir, main page]

Skip to c 8000 ontent

Commit a93fcc1

Browse files
eemeliaphillips
andauthored
Apply NFC normalization during :string key comparison (#905)
* Apply NFC normalization during :string key comparison * Add link to UAX#15 Co-authored-by: Addison Phillips <addison@unicode.org> --------- Co-authored-by: Addison Phillips <addison@unicode.org>
1 parent e9fc136 commit a93fcc1

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

spec/registry.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,14 @@ where `resolvedSelector` is the _resolved value_ of a _selector_
5555
and `keys` is a list of strings,
5656
the `:string` selector function performs as described below.
5757

58-
1. Let `compare` be the string value of `resolvedSelector`.
58+
1. Let `compare` be the string value of `resolvedSelector`
59+
in Unicode Normalization Form C (NFC) [\[UAX#15\]](https://www.unicode.org/reports/tr15)
5960
1. Let `result` be a new empty list of strings.
6061
1. For each string `key` in `keys`:
6162
1. If `key` and `compare` consist of the same sequence of Unicode code points, then
6263
1. Append `key` as the last element of the list `result`.
6364
1. Return `result`.
6465

65-
> [!NOTE]
66-
> Matching of `key` and `compare` values is sensitive to the sequence of code points
67-
> in each string.
68-
> As a result, variations in how text can be encoded can affect the performance of matching.
69-
> The function `:string` does not perform case folding or Unicode Normalization of string values.
70-
> Users SHOULD encode _messages_ and their parts (such as _keys_ and _operands_),
71-
> in Unicode Normalization Form C (NFC) unless there is a very good reason
72-
> not to.
73-
> See also: [String Matching](https://www.w3.org/TR/charmod-norm)
74-
7566
> [!NOTE]
7667
> Unquoted string literals in a _variant_ do not include spaces.
7768
> If users wish to match strings that include whitespace
@@ -90,6 +81,11 @@ the `:string` selector function performs as described below.
9081
9182
The `:string` function returns the string value of the _resolved value_ of the _operand_.
9283
84+
> [!NOTE]
85+
> The function `:string` does not perform Unicode Normalization of its formatted output.
86+
> Users SHOULD encode _messages_ and their parts in Unicode Normalization Form C (NFC)
87+
> unless there is a very good reason not to.
88+
9389
## Numeric Value Selection and Formatting
9490
9591
### The `:number` function

0 commit comments

Comments
 (0)
0