Which Unicode versions are supported in which OS X

2020-04-07 05:57发布

Is there a list or chart somewhere that shows which version of Unicode is supported on the various OS X and iOS releases? I can't find any documentation from Apple on this.

3条回答
Fickle 薄情
2楼-- · 2020-04-07 06:11

I've been looking for emojis supported by each OS X version. Here are my findings:

  • Mac OS X 10.5.8 and newer supports Unicode 4.1
  • OS X 10.7.5 and newer supports Unicode 6.1
  • OS X 10.11.5 and newer supports Unicode 8.0
查看更多
手持菜刀,她持情操
3楼-- · 2020-04-07 06:13

Apple is admittedly vague on their Unicode support, but Mac OS X and iOS nominally support Unicode 4.0. See the NSString documentation.

There are some caveats to be aware of:

Due to the vast number of characters represented by Unicode (in all its versions), you may need to test to determine if a specific transformation or operation is available for a particular character. However, any character representable by a UTF-16 code point or surrogate pair can be represented by NSString and CFString directly (though their semantic meaning might not be available in older OS versions, and they may render as unrecognized characters there.)

查看更多
ゆ 、 Hurt°
4楼-- · 2020-04-07 06:21

Is a Unicode Character implemented in the present iOS?

Admittedly a generalized version of StackOverflow question 41318999.

/// Tests against the existence of a given unicode glyph on the present OS
///
/// - Returns: true if this unicode glyph exists (i.e, not a [?])
func unicodeAvailable() -> Bool {
    let refUnicodeSize: CGFloat = 8
    if let refUnicodePng = Character("\u{1fff}").png(ofSize: refUnicodeSize),
        let myPng = self.png(ofSize: refUnicodeSize) {
        return refUnicodePng != myPng
    }
    return false
}

Usage

let code:Character = "\u{2764}" // ❤
print(code.unicodeAvailable())

true

Requires a method to create a png representation of a given character.

A complete description is given on StackOverflow, with an open source GitHub project.

查看更多
登录 后发表回答