Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在运行时从 Unix shell 脚本确定环境的当前代码页。这样做最可靠的方法是什么?
我正在研究解析环境变量 $LC_ALL,但它并不总是设置为有用的值,而且它的格式似乎有所不同(可以是 < locale > 或 < locale >.< code page > 或 < locale > .<代码页>@<修饰符> 等...)。
有没有更好的办法?如果我从 C 中调用 nl_langinfo(CODESET),我基本上是在追求一个与我得到的外壳等效的外壳。
跑:
locale charmap