Skip to content

[string] Comparison bug fix: Kelvin #16119

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 1 commit into from
Apr 24, 2018

Conversation

milseman
Copy link
Member

Unicode Kelvin sign normalizes to ASCII 'K', but our comparison logic
didn't handle this situation when the other side was single-byte all
ASCII. Fall back to the slow comparison path if the point of
difference between an all-ASCII string and a UTF-16 string falls on
such a non-ASCII-yet-normalizes-to-ASCII scalar (rare).

Unicode Kelvin sign normalizes to ASCII 'K', but our comparison logic
didn't handle this situation when the other side was single-byte all
ASCII. Fall back to the slow comparison path if the point of
difference between an all-ASCII string and a UTF-16 string falls on
such a non-ASCII-yet-normalizes-to-ASCII scalar (rare).
@milseman milseman requested a review from lancep April 24, 2018 00:49
@milseman
Copy link
Member Author

@swift-ci please test

Copy link
Contributor

@lancep lancep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. otherUTF16WithLeadingASCII is a good call as well

@harlanhaskins
Copy link
Contributor

Should we also have @Kelvin13 weigh in on this? 😉

@tayloraswift
Copy link
Member

i didn’t know unicode even had degree signs

@milseman milseman merged commit 8ef98b8 into swiftlang:master Apr 24, 2018
@milseman milseman deleted the unicode_mistake branch April 24, 2018 16:18
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