Skip to content

[5.0] NSRange: fix init from region RangeExpression in target String #1924

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

Merged
merged 4 commits into from
Feb 28, 2019
Merged

[5.0] NSRange: fix init from region RangeExpression in target String #1924

merged 4 commits into from
Feb 28, 2019

Conversation

ApolloZhu
Copy link
Contributor

Cherry pick #1894 to swift-5.0-branch

Prior to Swift 5, String uses UTF-16 for its Index and encodedOffset. However, this assumption is no longer valid and encodedOffset might be in UTF-8 for native contents in Swift 5.

This change should make the initializer work as expected under either circumstances.
And use more robust implementation
@spevans
Copy link
Contributor

spevans commented Feb 17, 2019

@swift-ci test

@ApolloZhu
Copy link
Contributor Author

Do I still need to do anything about this?

@millenomi
Copy link
Contributor

@swift-ci please test and merge

@swift-ci swift-ci merged commit b4a318a into swiftlang:swift-5.0-branch Feb 28, 2019
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.

4 participants