Which Unicode versions are supported in which OS X and iOS versions?

后端 未结 3 480
无人及你
无人及你 2021-01-18 13:18

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条回答
  • 2021-01-18 13:32

    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.

    0 讨论(0)
  • 2021-01-18 13:44

    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.)

    0 讨论(0)
  • 2021-01-18 13:53

    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
    0 讨论(0)
提交回复
热议问题