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

[SR-10451] Slice contents before asking ICU for grapheme breaking #52851

Closed
milseman mannequin opened this issue Apr 10, 2019 · 1 comment
Closed

[SR-10451] Slice contents before asking ICU for grapheme breaking #52851

milseman mannequin opened this issue Apr 10, 2019 · 1 comment
Assignees
Labels
standard library Area: Standard library umbrella

Comments

@milseman
Copy link
Mannequin

milseman mannequin commented Apr 10, 2019

Previous ID SR-10451
Radar None
Original Reporter @milseman
Type Sub-task
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Sub-task
Assignee @milseman
Priority Medium

md5: f3bcb4e5ee733cb8fcf02665b0b468ef

Parent-Task:

  • SR-10124 String.UTF16View.distance crashes on using misaligned String.Index with native String

Issue Description:

ICU gives different character distances if we slice or don't slice the contents. Given that we will be using this distance to make a Character, this can cause us to break the invariant that Character is length 1.

ICU's next-grapheme offset for ["61", "43E", "434", "438", "64", "65", "301", "65E5", "D83E", "DDDF", "200D", "2640", "FE0F"] at 10: 13
ICU's next-grapheme offset for ["200D", "2640", "FE0F"] at 0: 1

We need to slice our content prior.

@milseman
Copy link
Mannequin Author

milseman mannequin commented Jun 27, 2019

#23834

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

0 participants