[SR-6077] Character
ends up accepting invalid emoji flag sequences.
#48632
Labels
Character
ends up accepting invalid emoji flag sequences.
#48632
YOCKOW commentedOct 6, 2017
Environment
Swift 4.0
OS: macOS, Ubuntu 16.04
Additional Detail from JIRA
md5: c82e0168fd3a0f487ee734ba7518dfc4
relates to:
Issue Description:
The Swift code below will be compiled without any errors, although it does not conform to Unicode segmentation algorithm.
[code]
[Expected Result]
An error is raised such as "error: cannot convert value of type 'String' to specified type 'Character'".
[References]
UAX #29
> Do not break within emoji flag sequences. That is, do not break between regional indicator (RI) symbols if there is an odd number of RI characters before the break point.
> GB12 sot (RI RI)* RI × RI
> GB13 RI (RI RI)* RI × RI
UTS #51
> emoji flag sequence — A sequence of two Regional Indicator characters, where the corresponding ASCII characters are valid region sequences
> A singleton Regional Indicator character is called an ill-formed emoji flag sequence.
The text was updated successfully, but these errors were encountered: