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

Revert #1345, clarify comments and add tests #1348

Merged
merged 1 commit into from
May 6, 2021

Conversation

dbwiddis
Copy link
Contributor

@dbwiddis dbwiddis commented May 3, 2021

The code fix from #1343 was correct. I reverted the change in #1345, added more comments to clarify what is happening, and added tests for 1-, 2-, 3-, and 4-byte UTF8 characters.

Java uses one char for Unicode code points under 0xffff and two chars (with a leading high-surrogate code unit) for code points 0x10000 and higher, which correspond to the same number of "UTF-16 characters" in the Apple docs.

@matthiasblaesing
Copy link
Member

I had to reread the definition of String#length but looks sane to me.

@dbwiddis dbwiddis merged commit f89905a into java-native-access:master May 6, 2021
@dbwiddis dbwiddis deleted the cfstring branch May 6, 2021 22:03
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