“究竟是什么?”;地点“;在Mac OS X和/或其他Unix/Linux操作系统上执行此操作

“究竟是什么?”;地点“;在Mac OS X和/或其他Unix/Linux操作系统上执行此操作,linux,macos,locale,Linux,Macos,Locale,阅读 我认为该区域设置显示有关“当前区域设置”的信息或所有可用区域设置的列表 此外,运行 man locale 给 $ locale 然而,无论是人还是运行它实际上都没有揭示这些环境变量的作用。我想特别问一下,这些环境变量是需要的还是用来做什么的?(例如,在运行在具有这些环境变量的unix/linux操作系统上的软件的上下文中) 问题:对于在具有这些区域设置的操作系统上运行的软件,这意味着什么 哦,手册页()有: 也许,您在错误的部分查找了“locale”手册页?这些是标准部分(请参见man

阅读

我认为该区域设置显示有关“当前区域设置”的信息或所有可用区域设置的列表

此外,运行

man locale

$ locale
然而,无论是人还是运行它实际上都没有揭示这些环境变量的作用。我想特别问一下,这些环境变量是需要的还是用来做什么的?(例如,在运行在具有这些环境变量的unix/linux操作系统上的软件的上下文中)


问题:对于在具有这些区域设置的操作系统上运行的软件,这意味着什么

哦,手册页()有:

也许,您在错误的部分查找了“locale”手册页?这些是标准部分(请参见
man

因此,对于
locale
二进制,您必须查看
1
部分:
man 1 locale
。为了完全回答您的问题,我引用了locale手册页的描述部分:

0   Header files (usually found in /usr/include)
1   Executable programs or shell commands
2   System calls (functions provided by the kernel)
3   Library calls (functions within program libraries)
4   Special files (usually found in /dev)
5   File formats and conventions eg /etc/passwd
6   Games
7   Miscellaneous (including macro  packages  and  conven-
    tions), e.g. man(7), groff(7)
8   System administration commands (usually only for root)
9   Kernel routines [Non standard]
样本(
LC\u时间
LC\u消息
):


LC\u COLLATE
用于根据语言对信息进行排序
LC\u MONETARY
是货币的格式(美国:
$1.24
,欧洲:
1.24€

语言环境控制着很多事情,例如:

  • 正在使用的编码(即
    en_US.UTF-8
    ,或其他一些经典编码)
  • 用于标准库或其他应用程序的翻译文件
  • 国际化(数字格式、货币、日期)

  • C
    区域设置是“默认”区域设置。通常建议更具体一些,在Linux上作为启用UTF-8的东西运行

    这对于在具有这些区域设置的操作系统上运行的软件来说意味着什么?正是上述所有内容。区域设置表示程序和标准库在不同国际化和本地化设置下的运行方式。例如,对于一个区域设置,应该为该区域设置正确地排序日期:M/D/Y、Y/M/D等,一周中的几天,十进制分隔符是
    还是
    还是其他什么,消息应该是法语、英语还是中文,使用的是哪种字符编码。这两个答案都涉及上下文。事实上,LOCAL是上下文的一部分。在操作系统上使用这些Locale运行的软件上下文中,这意味着什么?Locale是作为一个在shell空间中以编程方式指定语言、标点符号差异和字符编码的系统出现的。它是纯UNIX的,早于Mac OS X。在Mac电脑上,shell从系统语言环境设置中提取,该设置由安装助手设置,在“国际首选项”窗格中可见且可更改。不过,我似乎在“系统首选项”应用程序上找不到用户界面。我目前在Mac 10.6.8上,它被称为Lion上的语言和文本。只需打开系统首选项应用程序,并在右上角的搜索字段中键入语言。可能存在重复的
    LC_CTYPE
    Character classification and case conversion.
    
    LC_COLLATE
    Collation order.
    
    LC_TIME
    Date and time formats.
    
    LC_NUMERIC
    Non-monetary numeric formats.
    
    LC_MONETARY
    Monetary formats.
    
    LC_MESSAGES
    Formats of informative and diagnostic messages and interactive responses.
    
    0   Header files (usually found in /usr/include)
    1   Executable programs or shell commands
    2   System calls (functions provided by the kernel)
    3   Library calls (functions within program libraries)
    4   Special files (usually found in /dev)
    5   File formats and conventions eg /etc/passwd
    6   Games
    7   Miscellaneous (including macro  packages  and  conven-
        tions), e.g. man(7), groff(7)
    8   System administration commands (usually only for root)
    9   Kernel routines [Non standard]
    
    DESCRIPTION
       The locale utility shall write information  about  the  current  locale
       environment,  or  all  public  locales, to the standard output. For the
       purposes of this section, a public locale is one provided by the imple-
       mentation that is accessible to the application.
    
       When  locale  is  invoked without any arguments, it shall summarize the
       current locale environment for each locale category  as  determined  by
       the  settings  of the environment variables defined in the Base Defini-
       tions volume of IEEE Std 1003.1-2001, Chapter 7, Locale.
    
       When invoked with operands,  it  shall  write  values  that  have  been
       assigned to the keywords in the locale categories, as follows:
    
        * Specifying  a  keyword  name  shall select the named keyword and the
          category containing that keyword.
    
        * Specifying a category name shall select the named category  and  all
          keywords in that category.
    
    $ export LC_TIME='fr_FR.UTF-8' #french time
    $ date
    mar. août 30 18:41:07 CEST 2011
    $ export LC_TIME='de_DE.UTF-8' #german time
    $ date
    Di 30. Aug 18:41:12 CEST 2011 #english time
    $ export LC_TIME='en_US.UTF-8'
    $ date
    Tue Aug 30 18:41:17 CEST 2011
    $ rm NON-EXIST
    rm: cannot remove `NON-EXIST': No such file or directory
    $ export LC_TIME='de_DE.UTF-8' #german time, but english MESSAGES
    $ rm NON-EXIST
    rm: cannot remove `NON-EXIST': No such file or directory
    $ export LC_MESSAGES='de_DE.UTF-8' #german messages
    $ rm NON-EXIST
    rm: cannot remove `NON-EXIST': Datei oder Verzeichnis nicht gefunden