c - setlocale() 的默认值是什么意思?

标签 c linux posix

setlocale()的默认设置是什么意思? setlocale()默认为“C”(“POSIX”)。但这到底是什么意思呢?它的默认字符集和语言是什么?是“en_US.utf8”吗?

最佳答案

来自 N1570:

7.11.1.1 The setlocale function

3 A value of "C" for locale specifies the minimal environment for C translation; a value of "" for locale specifies the locale-specific native environment. Other implementation-defined strings may be passed as the second argument to setlocale.

此外,来自脚注 222:

222) ISO/IEC 9945−2 specifies locale and charmap formats that may be used to specify locales for C.

这让您了解“C”在这种情况下的含义(因为脚注严格来说不是标准规范部分的一部分)。

关于c - setlocale() 的默认值是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10972547/

相关文章:

fgets 和 NULL 之间的比较

C - 调用 chmod 函数导致意外结果

java - 将文件存储到 S3 : local file vs HDFS

C - select() - 如何正确更新计时器

Posix 线程的条件变量

c - 在linux中创建非持久文件的最佳方法是什么

c - 如何编译 POSIX 定时器

linux - 破管不再结束程序?

c - shell脚本 "Thread: command not found"

c - 为什么 POSIX 要求 CHAR_BIT==8?