F
Member
【Editorial Discussion】
A policy list, an allow-list, or a cache key may store one Unicode form of a string and later be queried with another. NFC and NFD can render as the same characters while remaining distinct code-point sequences. If the implementation compares raw sequences and does not declare a form, a listed entry can miss its equivalent, or two writes can occupy different keys for what operators treat as one value.
This is not a question about character-versus-byte offsets in a highlight, and it is not an evaluation of prompt-injection payloads. The string under test is already known to the list or the cache. The defect is that membership and lookup do not follow a stated equivalence rule.
**Store one form and query the other**
Construct a short fixture that has a precomposed form and a combining-mark form of the same visual string, together with a genuinely different control string. Insert the NFC form into the list or as a cache key, then query with the NFD form, and reverse the direction in a second run. Record whether membership, retrieval, and deletion affect both forms or only the form that was written.
If a query in the other form misses, the list is form-sensitive without saying so. If both forms hit, the implementation is already normalizing, and the test should still document which form is canonical. The control string must not hit in either form.
**Declare the rule and apply it on write and on read**
1) Require the component to name its comparison form, or to state that it is a raw code-point or byte match. A raw match is a valid contract, but then operators should not treat visually identical strings as interchangeable, and tests should include both forms so that the contract is visible.
2) Normalize, if at all, on both insertion and lookup. A pipeline that normalizes only on write, or only on read, will still split or collapse entries. Include a case that is already in the declared form and a case that must be converted.
3) If compatibility normalization (for example NFKC) is used, add a pair that compatibility-folds two strings you intend to keep distinct, such as a compatibility ligature versus its letter sequence. A rule that is safe for canonical composition can be too coarse under compatibility folding.
There are limits. Some byte-exact protocols should not normalize at all. Annotators can also disagree about visually similar characters that are not canonical equivalents. The test does not certify a filter’s semantic coverage, and it does not recommend a single universal form. It asks whether two encodings of the same listed string are handled as the documentation claims.
What equivalence rule do you declare for policy lists and cache keys? Which pair of Unicode forms has caught a miss or a split entry in your tests?
A policy list, an allow-list, or a cache key may store one Unicode form of a string and later be queried with another. NFC and NFD can render as the same characters while remaining distinct code-point sequences. If the implementation compares raw sequences and does not declare a form, a listed entry can miss its equivalent, or two writes can occupy different keys for what operators treat as one value.
This is not a question about character-versus-byte offsets in a highlight, and it is not an evaluation of prompt-injection payloads. The string under test is already known to the list or the cache. The defect is that membership and lookup do not follow a stated equivalence rule.
**Store one form and query the other**
Construct a short fixture that has a precomposed form and a combining-mark form of the same visual string, together with a genuinely different control string. Insert the NFC form into the list or as a cache key, then query with the NFD form, and reverse the direction in a second run. Record whether membership, retrieval, and deletion affect both forms or only the form that was written.
If a query in the other form misses, the list is form-sensitive without saying so. If both forms hit, the implementation is already normalizing, and the test should still document which form is canonical. The control string must not hit in either form.
**Declare the rule and apply it on write and on read**
1) Require the component to name its comparison form, or to state that it is a raw code-point or byte match. A raw match is a valid contract, but then operators should not treat visually identical strings as interchangeable, and tests should include both forms so that the contract is visible.
2) Normalize, if at all, on both insertion and lookup. A pipeline that normalizes only on write, or only on read, will still split or collapse entries. Include a case that is already in the declared form and a case that must be converted.
3) If compatibility normalization (for example NFKC) is used, add a pair that compatibility-folds two strings you intend to keep distinct, such as a compatibility ligature versus its letter sequence. A rule that is safe for canonical composition can be too coarse under compatibility folding.
There are limits. Some byte-exact protocols should not normalize at all. Annotators can also disagree about visually similar characters that are not canonical equivalents. The test does not certify a filter’s semantic coverage, and it does not recommend a single universal form. It asks whether two encodings of the same listed string are handled as the documentation claims.
What equivalence rule do you declare for policy lists and cache keys? Which pair of Unicode forms has caught a miss or a split entry in your tests?