Skip to content

Commit 5457e06

Browse files
JLHwungmathiasbynens
authored andcommitted
Skip historical Quick_Check values in normalization properties
Unicode 3.1.0 through 4.0.0 record Quick_Check values in DerivedNormalizationProperties.txt as `NFC_NO`, `NFC_MAYBE`, and similar names instead of `NFC_QC; N`. Skip them like their modern equivalents, so they no longer appear as binary properties. Assisted-By: Claude Opus 5.5 Issue: #110
1 parent b1c5a5b commit 5457e06

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎scripts/parse-blocks-scripts-properties.mjs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ const parseBlocksScriptsProperties = async (type, version) => {
5959
const charRange = data[0].replace('..', '-').trim();
6060
let item = data[1].trim().replace(/\x20/g, '_');
6161
if (type === 'derived-normalization-properties') {
62-
if (item === 'FNC') {
62+
if (item === 'FNC' || /^NFK?[CD]_(?:NO|MAYBE)$/.test(item)) {
6363
// Old Unicode versions up to v4.0.0 use the `FNC` alias instead of
64-
// `FC_NFKC` (for `FC_NFKC_Closure`). This is not a binary property.
64+
// `FC_NFKC` (for `FC_NFKC_Closure`), and record Quick_Check values
65+
// as e.g. `NFC_NO` or `NFC_MAYBE` instead of `NFC_QC; N`. These are
66+
// not binary properties.
6567
continue;
6668
} else {
6769
const canonical = findCanonicalName(item);

‎tests/parsers.mjs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,24 @@ test('ArabicShaping fallback derives implicit joining types', async (t) => {
235235
}
236236
});
237237

238+
test('Historical Quick_Check values are not emitted as binary properties', async (t) => {
239+
for (const version of ['3.1.0', '3.1.1', '3.2.0', '4.0.0']) {
240+
const binary = await parseDerivedNormalizationProperties(version);
241+
for (const name of [
242+
'NFD_NO',
243+
'NFC_NO',
244+
'NFC_MAYBE',
245+
'NFKD_NO',
246+
'NFKC_NO',
247+
'NFKC_MAYBE',
248+
]) {
249+
t.assert.equal(binary[name], undefined, `${version}: ${name}`);
250+
}
251+
t.assert.ok(binary.Full_Composition_Exclusion.contains(0x340), version);
252+
t.assert.ok(binary.Expands_On_NFD.contains(0xc0), version);
253+
}
254+
});
255+
238256
test('Normalization mappings are not emitted as binary properties', async (t) => {
239257
for (const version of ['15.1.0', '16.0.0', '17.0.0', '18.0.0']) {
240258
const binary = await parseDerivedNormalizationProperties(version);

0 commit comments

Comments
 (0)