The Core Foundation function CFStringTransform()
has transformations that
determine the Unicode standard name for special characters. Example:
let c : Character = "??"
let cfstr = NSMutableString(string: String(c)) as CFMutableString
var range = CFRangeMake(0, CFStringGetLength(cfstr))
CFStringTransform(cfstr, &range, kCFStringTransformToUnicodeName, false)
print(cfstr)
Output:
N{SMILING FACE WITH OPEN MOUTH AND SMILING EYES}
See http://nshipster.com/cfstringtransform/ for more information about
CFStringTransform()
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…