Skip to content

Fix identity-entry filter miscounting non-BMP characters as multi-char - #50

Merged
frankslin merged 1 commit into
nk2028:mainfrom
frankslin:main
Sep 7, 2026
Merged

frankslin merged 1 commit into
nk2028:mainfrom
frankslin:main

Conversation

@frankslin

Copy link
Copy Markdown
Collaborator

k.length counts UTF-16 code units, so a single character above U+FFFF (e.g. 𪙏) reports length 2 and its self-mapping entry survives the "char => same char" filter meant to trim redundant dictionary rows. Switch to a code-point count via [...k].length.

Fixes #49

k.length counts UTF-16 code units, so a single character above U+FFFF
(e.g. 𪙏) reports length 2 and its self-mapping entry survives the
"char => same char" filter meant to trim redundant dictionary rows.
Switch to a code-point count via [...k].length.

Fixes nk2028#49
@frankslin
frankslin merged commit 49060d2 into nk2028:main Sep 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TSCharacters 字典轉換到 js 部分相同的字元沒有略去

1 participant