The text presentation selector (
U+FE0E
) dictates that it must not be rendered as emoji
It's not consistent:
In Xcode playground, it does as you said only when print to console area but not on the right side output area:
let renderAsText = "😀\u{FE0E}" // "😀︎" <== this is shown as emoji on the right side output area
print(renderAsText) // print out text form of 😀︎ in console output, but as "😀︎\n" on right side output area
But in iOS SwiftUI view, it output the emoji in both the SwiftUI.Text render and print out in console:
let _ = print("\u{1F600}\u{FE0E}") // this print out 😀 in console, not text!
Text("\u{1F600}\u{FE0E}") // this render on screen 😀, not text!
Is SwiftUI text rendering broken? It's like this in both iOS and macOS.
Edit: I tried in Terminal.app with zsh and a Swift console program, both show emoji:
print '\U1f600\UFE0E'
😀︎
cat emoji.swift
print("\u{1F600}\u{FE0E}")
swift emoji.swift
😀︎
So only in the Xcode Playground console area, ︎ follow by text presentation selector ( U+FE0E
) is shown as text. Since it works in this one case, I think the macOS font rendering is capable of respecting the text presentation selector ( U+FE0E
). But why doesn't it work in those other cases?
Edit: iPad Playground also not work, only show as regular emoji ︎