mostCompatibleStringEncoding
The string encoding that works best with the font.
Declaration
var mostCompatibleStringEncoding: UInt { get }Discussion
The string encoding in this property is the encoding with the fewest unmatched characters and glyphs in the font. If this value is NSASCIIStringEncoding, the font could not determine the correct encoding; you should assume the font can render only ASCII characters. The font uses heuristically well-known font encodings to determine the value of this property, so for nonstandard encodings the property may not contain the optimal string encoding.
You can use the data(using:) or data(using:allowLossyConversion:) methods of NSString to convert strings to this encoding.