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

Correctly compute offsets when text contains non-ASCII characters #40

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented Jun 19, 2020

We converted our text to UTF-8, while NSStrings are UTF-16 internally. Therefore, we'll have to do operations that report byte offsets on the UTF-8 data as well, rather than on the UTF-16 string. This fixes botched replacements for code that contains non-ASCII characters.

@kkaefer kkaefer merged commit 65b7aea into master Jun 19, 2020
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.

1 participant