以下内容来自官方手册
将编解码器设置为c; 这将由codecForLocale()返回。 如果c为nullptr,则将编解码器重置为默认值 Set the codec to c; this will be returned by codecForLocale(). If c is nullptr, the codec is reset to the default.
对于某些想要使用自己的机制来设置语言环境的应用程序,可能需要这样做 This might be needed for some applications that want to use their own mechanism for setting the locale.
警告:此函数不可重入 Warning: This function is not reentrant.
另请参见codecForLocale() See also codecForLocale().
// 返回最适合此语言环境的编解码器的指针 Returns a pointer to the codec most suitable for this locale.
// 编解码器将从使用该后端的ICU中检索,否则可以从特定于操作系统的API中获得。 在后一种情况下,编解码器的名称可以是“系统” The codec will be retrieved from ICU where that backend is in use, otherwise it may be obtained from an OS-specific API. In the latter case, the codec’s name may be “System”.
// 注意:此函数是线程安全的 Note: This function is thread-safe.
// 另请参见setCodecForLocale() See also setCodecForLocale().