标签: swift string
我在Swift中遇到了这个奇怪的问题:
let str = "" // US flag + German flag print(str.characters.count) // 1, why???
但如果我在两个标志之间添加一个空格,str.characters.count将返回3.
str.characters.count
我知道如何编码标志(每个标志2 REGIONAL INDICATOR SYMBOL LETTERS)。这是Unicode标准中的正确行为还是Swift错误?
REGIONAL INDICATOR SYMBOL LETTERS