Returns the default encoding used by the operating system when it creates strings.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The default string encoding.
This function returns the default text encoding used by the OS when it creates strings. In macOS, this encoding is determined by the user's preferred language setting. The preferred language is the first language listed in the International pane of the System Preferences.
In most situations you will not want to use this function, however, because your primary interest will be your application's default text encoding. The application encoding is required when you create a CFStringRef from strings stored in Resource Manager resources, which typically use one of the Mac encodings such as MacRoman or MacJapanese.
To get your application's default text encoding, call the GetApplicationTextEncoding Carbon function.