“语言环境”在Mac OS X和/或其他Unix / Linux操作系统上的作用究竟是什么

前端之家收集整理的这篇文章主要介绍了“语言环境”在Mac OS X和/或其他Unix / Linux操作系统上的作用究竟是什么前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

  1. man locale

我认为该语言环境显示有关“当前语言环境”的信息或所有可用语言环境的列表.

另外,跑步

  1. $locale

给…

  1. LANG=
  2. LC_COLLATE="C"
  3. LC_CTYPE="C"
  4. LC_MESSAGES="C"
  5. LC_MONETARY="C"
  6. LC_NUMERIC="C"
  7. LC_TIME="C"
  8. LC_ALL=

然而,无论是男性还是实际操作它都无法揭示这些环境变量的作用.我想具体问一下这些环境变量需要用于什么? (比如在这个具有这些环境变量的unix / linux操作系统上运行的软件的上下文中)

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

最佳答案
哦,手册页(@L_301_0@):

  1. LC_CTYPE
  2. Character classification and case conversion.
  3. LC_COLLATE
  4. Collation order.
  5. LC_TIME
  6. Date and time formats.
  7. LC_NUMERIC
  8. Non-monetary numeric formats.
  9. LC_MONETARY
  10. Monetary formats.
  11. LC_MESSAGES
  12. Formats of informative and diagnostic messages and interactive responses.

也许,您在错误的部分查找了“区域设置”联机帮助页?这些是标准部分(见男人)

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

因此,对于语言环境二进制文件,您必须查看第1节:man 1语言环境.为了完整回答您的问题,我引用了locale的手册页的描述部分:

  1. DESCRIPTION
  2. The locale utility shall write information about the current locale
  3. environment,or all public locales,to the standard output. For the
  4. purposes of this section,a public locale is one provided by the imple-
  5. mentation that is accessible to the application.
  6. When locale is invoked without any arguments,it shall summarize the
  7. current locale environment for each locale category as determined by
  8. the settings of the environment variables defined in the Base Defini-
  9. tions volume of IEEE Std 1003.1-2001,Chapter 7,Locale.
  10. When invoked with operands,it shall write values that have been
  11. assigned to the keywords in the locale categories,as follows:
  12. * Specifying a keyword name shall select the named keyword and the
  13. category containing that keyword.
  14. * Specifying a category name shall select the named category and all
  15. keywords in that category.

样品(LC_TIME和LC_MESSAGES):

  1. $export LC_TIME='fr_FR.UTF-8' #french time
  2. $date
  3. mar. août 30 18:41:07 CEST 2011
  4. $export LC_TIME='de_DE.UTF-8' #german time
  5. $date
  6. Di 30. Aug 18:41:12 CEST 2011 #english time
  7. $export LC_TIME='en_US.UTF-8'
  8. $date
  9. Tue Aug 30 18:41:17 CEST 2011
  10. $rm NON-EXIST
  11. rm: cannot remove `NON-EXIST': No such file or directory
  12. $export LC_TIME='de_DE.UTF-8' #german time,but english MESSAGES
  13. $rm NON-EXIST
  14. rm: cannot remove `NON-EXIST': No such file or directory
  15. $export LC_MESSAGES='de_DE.UTF-8' #german messages
  16. $rm NON-EXIST
  17. rm: cannot remove `NON-EXIST': Datei oder Verzeichnis nicht gefunden

LC_COLLATE用于根据语言对信息进行排序. LC_MONETARY是货币的格式(美国:1.24美元,欧洲:1.24€)

猜你在找的Linux相关文章