开发者

What is the most robust way to determine the current codepage from a shell script?

I'd like to determine the environment's current codepage at runtime from a Unix shell script. What's the most reliable way of doing this?

I'm looking into parsing environment variable $LC_ALL, but it isn't always set to a useful value, and it开发者_如何学编程s format seems to vary (can be <locale>, or <locale>.<code page>, or <locale>.<code page>@<modifier> etc...).

Is there a better way? I'm essentially after a shell equivalent of what I'd get if I called nl_langinfo(CODESET) from C.


Run:

locale charmap
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜