nix语言环境设置中的zh

nix语言环境设置中的zh

本文介绍了* nix语言环境设置中的zh_CN.UTF-8和en_US.UTF-8有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在* nix系统上工作时,我总是将语言环境设置为en_US.UTF-8,这样可以帮助我在标准输出上正确显示中文.

When working on *nix system, I always set the locale as en_US.UTF-8, and then this can help me display the Chinese correctly on the stdout.

但是我知道语言环境设置也有zh_CN.UTF-8,所以我想知道:
它们有什么不同?
我什么时候应该使用zh_CN.UTF-8或en_US.UTF-8?

But I know that there is also zh_CN.UTF-8 for locale setting as well, so I want to know:
What the the different of them?
When should I use zh_CN.UTF-8 or en_US.UTF-8?

推荐答案

对zh本身零知识,在您提到的两个语言环境之间进行更改可能会更改在单词边界处对待某些字符的方式以及不同程序如何产生输出.

Having zero knowledge about zh in itself, changing between the two locales you mentioned may change how certain characters are treated at a word boundary and how different programs produce output.

例如,LC_CTYPE=zh_CN.UTF-8最有可能将带有重音符号的字符视为单词的一部分",而LC_CTYPE=en_US.UTF-8可能不会将那些带有重音符号的字符视为单词的一部分.

For example LC_CTYPE=zh_CN.UTF-8 will most likely consider characters with accent marks as "being part of a word" whereas LC_CTYPE=en_US.UTF-8 might not consider those being part of a word.

日期和货币格式相同.我非常确定zh的日期/货币格式将与我们不同.

Same goes for date and currency formats. As I'm pretty sure zh will have different date/currency format than us.

给你一个具体的例子,这是我从date(1)中得到的,它是在相对较新的Ubuntu GNU/Linux系统中具有两个不同语言环境的:

To give you a concrete example, here is what I get from date(1) with two different locales in a relatively recent Ubuntu GNU/Linux system:

user@devbook:~$ LC_TIME=fi_FI.UTF-8 date
to 16.1.2014 07.14.36 +0200
user@devbook:~$ LC_TIME=en_US.UTF-8 date
Thu Jan 16 07:14:42 EET 2014

这篇关于* nix语言环境设置中的zh_CN.UTF-8和en_US.UTF-8有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 19:19