Contents

CFStringGetSmallestEncoding(_:)

Returns the smallest encoding on the current system for the character contents of a string.

Declaration

func CFStringGetSmallestEncoding(_ theString: CFString!) -> CFStringEncoding

Parameters

  • theString:

    The string for which to find the smallest encoding.

Return Value

The string encoding that has the smallest representation of theString.

Discussion

This function returns the supported encoding that requires the least space (in terms of bytes needed to represent one character) to represent the character contents of a string. This information is not always immediately available, so this function might need to compute it.

See Also

Working With Encodings