CFLocale
Declaration
class CFLocaleOverview
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 CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:))—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 CFLocaleRef, and in a function where you see a CFLocaleRef parameter, you can pass in an NSLocale instance. See Toll-Free Bridged Types for more information on toll-free bridging.
Topics
Creating a Locale
Getting System Locale Information
Getting ISO Information
CFLocaleCopyISOCountryCodes()CFLocaleCopyISOLanguageCodes()CFLocaleCopyISOCurrencyCodes()CFLocaleCopyCommonISOCurrencyCodes()
Language Preferences
Getting Information About a Locale
Getting and Creating Locale Identifiers
CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(_:_:_:)CFLocaleCreateCanonicalLanguageIdentifierFromString(_:_:)CFLocaleCreateCanonicalLocaleIdentifierFromString(_:_:)CFLocaleCreateComponentsFromLocaleIdentifier(_:_:)CFLocaleCreateLocaleIdentifierFromComponents(_:_:)CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(_:_:)CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(_:)
Getting Line and Character Direction for a Language
Getting the CFLocale Type ID
Constants
See Also
Related Documentation
- Internationalization and Localization Guide