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

Han unification regex is incorrect #107

Open
KarolS opened this issue May 21, 2024 · 0 comments
Open

Han unification regex is incorrect #107

KarolS opened this issue May 21, 2024 · 0 comments

Comments

@KarolS
Copy link

KarolS commented May 21, 2024

The regex tries to use 5-digit Unicode escapes, but Unicode escapes are only 4-digit, which makes it not work.

For example this fragment: \u20000-\u2A6DF is interpreted as 3 Unicode ranges:

  • U+2000 (which is not a Han character)

  • from 0 (U+0030) to U-2A6D (which encompasses tons of various characters, including the entire Latin alphabet, but no Han characters)

  • F (U+0045)

I guess the regex should be rewritten using surrogates, like the emoji one.

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

1 participant