Skip to content

[SR-3582] Counting emoji flags #46167

Closed
Closed
@swift-ci

Description

@swift-ci
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrella

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions