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

Fix error caused by a single Unicode before a surrogate pair #219

Conversation

irisTa56
Copy link
Contributor

This PR fixes an error that occurs when a zero-width joiner is placed before a surrogate pair (related to my comment in #217).

Problem

The current implementation always validates two consecutive Unicode sequences as a surrogate pair.
This cause an error when an independent Unicode sequence is followed by a surrogate pair, which should be valid.

Caveats

Relating to this fix, an unpaired surrogate character at the end of a string will cause an error, which is silently ignored by the current implementation.

@irisTa56 irisTa56 changed the title Avoid error caused by single Unicode before a surrogate pair Fix error caused by a single Unicode before a surrogate pair Feb 27, 2024
@devinus devinus merged commit ef8b22d into devinus:master Jun 1, 2024
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.

2 participants