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

Incorrect IsUtf8 position check? #1

Open
pedasmith opened this issue Mar 10, 2019 · 2 comments
Open

Incorrect IsUtf8 position check? #1

pedasmith opened this issue Mar 10, 2019 · 2 comments

Comments

@pedasmith
Copy link

It looks like a lot of the UTF8 checker code on GitHub is all copied with what appears to be the same issue: if the utf8 multi-byte sequence is at the end of the buffer, it's incorrectly marked as invalid. AFAICT, all of the checks for position >= length -2 (or whatever) should be position > length-2.

@pedasmith
Copy link
Author

FYI: I've just created a near drop-in IsUtf8 replacement; that project includes a bunch of unit tests.

@arthurzaczek
Copy link
Member

Cool! Thank you! I'll have an in deep look at it next week.

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