Framework
- Core Foundation
Overview
Unicode operations such as collation and text boundary determination can be affected by the conventions of a particular language or region. CFLocale objects specify language-specific or region-specific information for locale-sensitive operations.
The CFLocale opaque type provides support for obtaining available locales, obtaining localized locale names, and converting among locale data formats. Locale identifiers in macOS follow the IETF’s BCP 47. CFLocale never uses Script Manager codes (except for the legacy support provided by CFLocale
)—the Script Manager and all its concepts are deprecated.
For more information on locale identifiers, read Internationalization and Localization Guide. It is also useful to read the ICU’s User Guide for the Locale Class.
CFLocale is “toll-free bridged” with its Cocoa Foundation counterpart, NSLocale
. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSLocale *
parameter, you can pass in a CFLocale
, and in a function where you see a CFLocale
parameter, you can pass in an NSLocale
instance. See Toll-Free Bridged Types for more information on toll-free bridging.