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

Character loss due to encoding #112

Closed
hmmhmmhm opened this issue May 19, 2020 · 3 comments · Fixed by #176
Closed

Character loss due to encoding #112

hmmhmmhm opened this issue May 19, 2020 · 3 comments · Fixed by #176
Labels

Comments

@hmmhmmhm
Copy link

스크린샷 2020-05-19 오후 4 39 04

스크린샷 2020-05-19 오후 4 39 13

If a character such as Hangeul goes through this library, some of the characters will be lost.
Perhaps an error is caused by letters exceeding 2 byte.

@hmmhmmhm
Copy link
Author

스크린샷 2020-05-19 오후 4 47 02

I think this is an error caused by this module using string-width module.
Pure Javascript can calculate the exact number of characters in Unicode characters.
(.length is always 1)

However, the string-width module appears to calculate the number of bytes, not letters.

@gajus
Copy link
Owner

gajus commented May 19, 2020

Happy to replace string-width if there is a better alternative.

@gajus gajus added the bug label May 19, 2020
@hmmhmmhm
Copy link
Author

hmmhmmhm commented May 21, 2020

I don't know why this project trying to use string-width module, is there an example that can't handle with pure JavaScript .length method?

@nam-hle nam-hle linked a pull request May 14, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants