Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BMP外字符判定不一致 #7

Open
bczhc opened this issue Mar 1, 2023 · 4 comments
Open

BMP外字符判定不一致 #7

bczhc opened this issue Mar 1, 2023 · 4 comments

Comments

@bczhc
Copy link

bczhc commented Mar 1, 2023

image
下方字符为U+10000,BMP外的字符。

image

image
上方字符为𪻐(U+2AED0),当跟打区为BMP内字符时,上方出现分开的UTF-16代理对。

@bczhc
Copy link
Author

bczhc commented Mar 3, 2023

所有的BMP外的字符判定都有问题。比如“𪻐”字,会显示“共2字”。不应该使用UTF-16字符串的长度判定字数。

@bczhc
Copy link
Author

bczhc commented Mar 5, 2023

就是打文时有时打了个超集字,还以为打了个二字词,就回删,删多了。

@owenyang0
Copy link
Owner

这是一个已知问题,js默认判断字符的长度不包含超字集
暂时还没有时间去处理

@bczhc
Copy link
Author

bczhc commented Apr 2, 2023

以及文章中凡是有BMP外的字,乱序都出问题。比如来𪻐 -> �来�,那两个方框替代字符就是被拆开来的代理对。解决这个问题只需使用Array.from(text)[...text]的方式,而不是.split('')来拆分。

bczhc added a commit to bczhc/easy-typer that referenced this issue Apr 11, 2023
bczhc added a commit to bczhc/easy-typer that referenced this issue Apr 11, 2023
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

No branches or pull requests

2 participants