diff --git a/.changeset/short-toes-fix.md b/.changeset/short-toes-fix.md new file mode 100644 index 0000000..fc1db2d --- /dev/null +++ b/.changeset/short-toes-fix.md @@ -0,0 +1,5 @@ +--- +"unicode-segmenter": patch +--- + +Fixed G9Bc edge case. The `0x0A4D` (Gurmukhi Sign Virama) was incorrectly treated as InCB=Linker. diff --git a/src/grapheme.js b/src/grapheme.js index bf0ec83..fdc8ce8 100644 --- a/src/grapheme.js +++ b/src/grapheme.js @@ -151,7 +151,6 @@ const PAIR = Uint8Array.from(grapheme_pairs); function isLinker(cp) { return cp === 0x094D // Devanagari Sign Virama || cp === 0x09CD // Bengali Sign Virama - || cp === 0x0A4D // Gurmukhi Sign Virama || cp === 0x0ACD // Gujarati Sign Virama || cp === 0x0B4D // Oriya Sign Virama || cp === 0x0C4D // Telugu Sign Virama diff --git a/test/grapheme.js b/test/grapheme.js index 8d9056f..8e5b995 100644 --- a/test/grapheme.js +++ b/test/grapheme.js @@ -353,6 +353,10 @@ test('counterexamples', async t => { 'क‌्क', 'क゙्क', 'ൎക്ക', + // GB9c: U+0A4D (Gurmukhi Sign Virama) is *not* InCB=Linker per DerivedCoreProperties.txt; + // the lib must not treat it as one even when it appears inside an InCB=Consonant run from another script + '\u0915\u0A4D\u0915', // DEVANAGARI KA + GURMUKHI VIRAMA + DEVANAGARI KA + '\u0A15\u0A4D\u0A15', // pure Gurmukhi KA + virama + KA (InCB=None - harmless) // Hangul Jamo Extended-B boundaries; U+D7FC..U+D7FF are unassigned '가퟼', 'ퟻ퟼',