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-3582] Counting emoji flags #46167

Closed
swift-ci opened this issue Jan 9, 2017 · 2 comments
Closed

[SR-3582] Counting emoji flags #46167

swift-ci opened this issue Jan 9, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jan 9, 2017

Previous ID SR-3582
Radar None
Original Reporter S2dent (JIRA User)
Type Bug
Status Resolved
Resolution Invalid
Environment

MacOSX iOS

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 3ed43ec703bc4462ba30ecf03b6067e2

is duplicated by:

  • SR-4077 Consecutive flag emoji are treated as a single character

relates to:

  • SR-6076 [String] var count: String.CharacterView.IndexDistance { get } returns a wrong value on Linux when "Regional Indicator Symbols" are contained.

Issue Description:

Flags are not distinguished in characters.count

Example:

 // Here are three country flags emojis
let flags = "\u{1F1E6}\u{1F1E8}\u{1F1F7}\u{1F1F4}\u{1F1F7}\u{1F1FA}"
flags.characters.count // 1

No matter how many flags, or in which order, the result is always 1.

@belkadan
Copy link
Contributor

This is "correct" (standards-compliant) behavior in Unicode 8, and will be "fixed" when Swift upgrades to implement Unicode 9.

@belkadan
Copy link
Contributor

For more information, see UAX #29 in Unicode 8 and Unicode 9.

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants