免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1985 | 回复: 0
打印 上一主题 下一主题

Solaris Locale [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-12-19 00:20 |只看该作者 |倒序浏览

包含了最新的Solaris 10 locale的详细信息。原文见
http://developers.sun.com/dev/gadc/faq/locale.html
  • What is a locale?
  • What locales are provided with Solaris Operating Environment?
  • How do I add a locale after installing the Base Product?
  • Where can I get specific locales?
  • What is the difference between a partial and a full locale?
  • How do I run a localized environment once it has been installed?
  • Can I use English to install Japanese Solaris Operating Environment?
  • Can I install Chinese, Japanese, Korean, and European locales on the same Solaris system?
  • Chinese Locales
  • Turkish Language Support
  • Customizing and Creating My Own Solaris Locales
  • What locales are available on the different versions of Solaris?
  • Why do Solaris 9 and Solaris 10 insert a ':' into the TZ variable?
  • What is the difference between the en_US.UTF-8 and ja_JP.UTF-8 locales
  • Do either the gethostname and sethostname functions support non-ASCII characters?
  • The /etc/rc2.d/S95IIim script and the C or en_US.ISO8859-1 locales
  • Viewing a UTF-8 encoded .csv file with Chinese characters.
  • How do I install the en_CA.ISO8859-1 locale on Solaris 10?
  • In Solaris 10, can I add locales at install time with both the CUI and GUI install interfaces?
  • Is there a Dutch UTF-8 locale in Solaris 9?
  • Why does sort fail in a UTF-8 locale, but works fine in the C locale?
  • I can't properly see Hebrew characters, I see only strings like /347/322/251. Is there any problem in installation?
  • Difficultly viewing a Japanese file.
  • How do I reset the default locale from ssh and reboot with the new locale?
  • Do you offer a locale which conforms to ISO8601?
  • How do I know which locales are installed on Solaris?
  • Is UTF-16 a valid and supported font set in Solaris 8 and 9?
  • What locales are shipped with Solaris 10 UR2 [June 2006]?
    1. What is a locale?
    A locale is a collection of files, data, and sometimes code, which contain the necessary information to adapt Solaris to a specific geographical market. It is essentially a "bundle", containing information such as the messages displayed to the user, interface component information, for example the size of the buttons; cultural information such as dates and currency formats, and fonts or other writing specific information.
    2. What locales are provided with Solaris?
    Solaris supports a global set of languages that can be added or removed at any time. Globalization is enhanced through extensive support over 37 languages, 123 locales, and complex text formats for Arabic, Thai and Hebrew, along with support for the development of multilingual applications.
    See details for:
  • Solaris 10 Update Release 2
    Solaris 10 UR2 now ships with all the locales listed in the
    Solaris 10
    , plus the locales listed at
    http://developers.sun.com/techtopics/global/products_platforms/solaris/reference/techart/s10-locale-patches.html
    .

  • Solaris 10


  • Solaris 9


  • Solaris 8

    3. How do I add a locale after installing the Base Product?
    Solaris 10 added the new localeadm command line utility. It allows you to add support for specific geographic regions. Please take a look at the
    man page
    .
    For Solaris 7, 8 & 9 it requires that you pkgadd the right packages. For more details, including package lists, please see the
    Solaris 9
    ,
    Solaris 8
    and
    Solaris 7
    pages.
    4. Where can I get specific locales?
    There are no downloads for Solaris locales. All the locales are included on one of your CDs or DVD.
    5. What is the difference between a partial and a full locale?
    A partial locale provides support for date/time format, monetary and numeric format, and collation sequence. A partial locale also defines printable characters, uppercase and lowercase characters, and graphic characters.
    A full locale provides the same information plus translated system messages.
    6. How do I run a localized environment once it has been installed?
    If you're running Gnome, select a locale at login.
    If you're running CDE, select a locale at login.
    7. Can I use English to install the Japanese Solaris distribution?
    Yes. The first window you see when installing Solaris enables you to choose the language you want to use for the installation. See
    Q3
    .
    8. Can I install Chinese, Japanese, Korean, and European locales on the same Solaris system?
    Yes. From Solaris 8, all Chinese, Japanese, Korean, and European locales are included on the base CD with localised messages on a separate "Language" CD. These locales and messages are selected at install time, or added
    post-install
    .
    9. I installed Chinese packages from languages cd. I then tried "setenv LANG zh_TW" but got an error - "Locale could not be set properly". What am I doing wrong?
    It is most likely the case that one or more required packages were not installed properly. On Solaris 10 please refer to the
    localeadm
    utility. Otherwise refer to the locale package pages for
    Solaris 9
    ,
    Solaris 8
    and
    Solaris 7
    .
    By-the-way, using Chinese as the installation language is not enough to install all Chinese locales. Users still need to select all of the locales they need from the GEO screen during the installation. Only zh or zh_TW locale is installed by default when Simplified Chinese or Traditional Chinese is used as the installation langauge.
    10. What Turkish language support is available for Solaris?
    Solaris supports the Turkish language in that you can input, display, and print Turkish. It also supports cultural elements like date/time formats, currency, sorting etc. Solaris does not provide Turkish translations for system messages and application text (e.g. GUI menus/buttons etc. Turkish support has been in Solaris since Solaris 2.6.
    11. How do I customize and create my own Solaris locales?
    See
    this techtip
    .
    12. What locales are available on the different versions of Solaris?
    This
    sortable chart
    lists what locales are available in Solaris 7, 8 and 9.
    13. My timezone - TZ - variable is set to ":CST6CDT". Why do Solaris 9 and Solaris 10 insert a ':' into the TZ variable? Is a colon [:] in the TZ variable POSIX compliant?
    The three different ways to set timezone at install are:

    • geograpy/region
    • GMT offset
    • filename (from /usr/share/lib/zoneinfo/*)
    If user selects to specify a filename and that filename also qualifies as a POSIX timezone, then the ":" is prepended to the value stored in /etc/default/init so that we know that the TZ has been set from a file as opposed to the POSIX timezone implementation built into libc.
    The POSIX standard (since 1990 - POSIX 1003.1:1990, p.152) does support ':' as the first character of the timezone, though it specifies such a timezone is implementation defined. So although the behavior is not specified, ":CST6CDT" is a POSIX-compliant value for TZ.
    If your TZ value is from filename and if you wish to have the TZ value without the ':', you could either edit the /etc/default/init and remove the character if the timezone file already exists at Solaris. Alternatively, specifying "timezone=" value at the sysidcfg(4) file that can be used during system installation is another way.
    Also refer to the TZ section of environ(5) man page.
    14. What is the difference between the en_US.UTF-8 and ja_JP.UTF-8 locales in the Solaris OS?
    The two locales are one of the many UTF-8 locales that share many underlying frameworks and definitions, i.e., locale methods, output methods, input methods and so on and even LC_CTYPE locale definition are the same.
    Also, most notably, both share the same file and process/wchar_t code representations, and so text data are completely interchangeable between the two locales without any need of code conversions.
    All other locale definitions are however different, for instance, they both have different LC_COLLATE, LC_MONETARY, LC_NUMERIC etc. definitions. The ja_JP.UTF-8 also has different and additional font charsets supported since Japanese users need more JIS X font charsets such as JIS X 0212.
    The ja_JP.UTF-8 locale provides fully translated Japanese messages in GUI, CUI, man pages and so on (well, on most of them). The ja_JP.UTF-8 locale also provides its own libraries and utilities that Japanese customers are expecting to have in their locale environment.
    15. The gethostname and sethostname calls take a char* as first argument. Does either of these functions support non-ASCII characters?
    Hostnames and Internet style domain names must stay in the subset of 7-bit ASCII as specified in RFC952, 1035, 1122, and 1123.
    http://www.ietf.org/rfc/rfc952.txt
    .
    If you though wish to support non-ASCII characters at the host or domain names with your program, you can use IDN conversion functions such as idn_encodename(3EXT), idn_decodename(3EXT) to convert between non-ASCII names and ACE (ASCII Compatible Encoding) names and use the ACE names at the system files, networking interfaces, and so on where the 7-bit ASCII names are required.
    In other words, your application is required to do the conversions between non-ASCII names and ACE names before using the ACE names at the various places where host and domain names are used in the system. (Of course, users would expect to see non-ASCII names when they are dealing with your program and so this conversion should be supported transparently by your program.)
    For more details, please see the idn_encodename(3EXT) man page at S9 Update 6 or later and S10 or later systems and also "Internationalized Domain Name (IDN) Support" section of the S10 International Language Environments Guide at the following:
    http://docs.sun.com/app/docs/doc/817-2521/6mi67tj3q?a=view
    We also added idnconv(1) utility in addition to iconv code conversion at S10 by the way. Please also see RFC3490 for more info on IDN.
    16. The /etc/rc2.d/S95IIim script starts the htt daemon on port 9010. If my default locale is C or en_US.ISO8859-1, will I be missing any functionality if I don't start this daemon?
    No, you won't miss anything with C or en_US.ISO8859-1.
    17. I need to be able to view a UTF-8 encoded .csv file with Chinese characters from an Oracle database. Right now all the Chinese characters are garbled.
    You could login to any of the UTF-8 locales - for example zh_CN.UTF-8, and then open the file with vi or any other editor.
    Alternatively, you could just open the .csv file in a browser, and change the encoding to UTF-8 [View/Character Encoding/UTF-8 in Mozilla]. This should work for modern browsers - with the right fonts - regardless of the locale you are actually running in. See
    here
    .
    18. How do I install the en_CA.ISO8859-1 locale on Solaris 10?
    See the
    above
    question, or the
    localeadm
    man page.
    19. In Solaris 10, can I add locales at install time with both the CUI and GUI install interfaces - or do I have to use localeadm post install?
    Locales can be added at install time via the CUI or GUI. One also could do a JumpStart based installation and specify all necessary locales to be installed in the JumpStart profile file.
    20. Is there a Dutch UTF-8 locale in Solaris 9?
    Dutch UTF-8 support [as well as UTF-8 support for many other European languages] for Solaris 9 is available as a sparc patch. The patch ID is 117100-04. It can be downloaded from
    SunSolve
    .
    21. Why does sort fail in a UTF-8 locale, but works fine in the C locale?
    The file that you are sorting probably has Latin-1 characters. These bytes are illegal (and considered as harmful due to security reason) characters in UTF-8 locales and thus during the collation, such illegal characters were detected. This somehow mapped to EMSG_ERROR error condition at the sort(1).
    The solution is to convert your file to UTF-8 using iconv(1) prior to the sorting. Try this:
    # iconv -f 8859-1 -t UTF-8 my-file.txt
    Then run sort as normal.
    22. I can't properly see Hebrew characters, I see only /347/322/251. Is there any problem in installation?
    The first thing to check is if you have the Hebrew localization packages properly installed and what locale is being used on your desktop. In C locale where only ASCII characters are allowed, all Hebrew characters, esp., in OS commands, will show up as escaped octal character sequences as you explained and showed.
    There are several things to be done to properly see Hebrew characters:

    • Please install all Hebrew localization packages. If you would like to use Hebrew script in any of the Unicode/UTF-8 locales, please also make sure to install the corresponding UTF-8 locale packages. View the package lists
      here
      .
    • Once these locales have been properly installed, you can login to CDE in either an 'he' (ISO8859-8) or, say, en_US.UTF-8 locale - depending on your preferred codeset.
    • Pretty much all applications will be able to handle (input and output) Hebrew characters after the CDE Login.
    For more info on UTF-8 locale and Hebrew input, please see the Overview of en_US.UTF-8 Locale Support chapter at the S8 International Language Environments Guide at the following URL
    http://docs.sun.com/app/docs/doc/806-0169

    23. We are trying to view a file in Japanese language on the Solaris 8 platform. We're not sure of its encoding, but have converted it to UTF-8 with:
    iconv -f  eucJP -t UTF-8  ja-file.txt
    iconv -f  PCK -t UTF-8  ja-file.txt
    However it produdes errors like iconv: conversion error and Conversion error detected.
    The iconv is failing because, I believe, your source file is not encoded as either eucJP or PCK. Or, another possibility is that there might be an error code in the source file even though it is PCK or eucJP file.
    That said, if you only want to *view* the Japanese file then you don't necessarily have to convert it to UTF-8. Open it in a browser [browser must have correct font support], and follow the steps in the second part of this
    article
    .
    Using the new Solaris 10 auto_ef utility is the best way to determine the encoding of a file. If you don't have Solaris 10 - you can download it from
    http://www.sun.com/software/solaris/
    .

  • 24. How do I reset the default locale from ssh and reboot with the new locale?
    To change the default locale of a machine, you need to set environment variables in the /etc/default/init file.
    See http://docs.sun.com/app/docs/doc/816-0677/6m758jcqf?a=view for an example of how it is done. If the LC_* variables are not set in this file, then the default locale is the 'C' locale.
    To reboot the system from the ssh shell, as root, simply type 'reboot'.
    25. Do you offer a locale which conforms to ISO8601?
    No we don't offer a locale which conforms to ISO8601. I'm afraid there is no current plan to introduce an ISO8601 type locale variant so for the moment you have at least 3 options:
  • Build your own with localedef.
  • Use the strftime () function to format the date if they need the date inside an app written in C/C++/perl etc.
  • Use "date +%Y-%m-%d" if it's a shell script.
    26. How do I know which locales are installed on Solaris?
    You simply need to run:
    # locale -a
    Note: Some locales are partial, others are full. A partial locale has the currency, date/time format etc. - like the Polish locale: pl_PL.UTF-8, while a full locale has that plus full translations for the user interface. - say the Spanish es_ES.UTF-8 locale.
    For adding locale support see
    http://developers.sun.com/dev/gadc/techtips/sol9_locale_pkgs/index.html

    27. Is UTF-16 a valid and supported font set in Solaris 8 and 9?
    Java 1.5 supports UTF-16 as its primary codeset. Solaris support UTF-16 only through iconv code conversions.
    All major TrueType (and so thus OpenType) fonts themselves are encoded by using UTF-16 but only BMP portion usually, i.e., UCS-2. Solaris maps such and any other font encodings into various X11 encodings such as ISO8859-1, eucJP, Big5, Shift_JIS, KOI8-R, UTF-8 and so on by using various internal mechanisms that are transparent to users and fonts.
    We do not support UTF-16 as an X11 fontset. Unicode locales in Solaris however supports an X11 fontset (UTF-8) to support Unicode/UTF-8 characters; that fontset can be used to display Unicode characters in X11 applications.
    We also do not have any plan to support UTF-16 fontset directly since that's not really possible due to for instance, UTF-16 encoding alone doesn't contain enough characters required for rendering of context-dependent shaping and bidirectional scripts. I.e., Unicode defines logical characters but not all presentation characters and some scripts/languages require many more presentation characters than what the Unicode defines; it is up to each GUI components of platforms on how to map such logical characters to presentation characters after shaping and ordering.
    28. What locales are shipped with Solaris 10 UR2?
    Solaris 10 UR2 [June 2006] ships many new UTF-8 locales. See
    here
    for the complete list. If you have an earlier release of Solaris 10, and want to add those locales that have only been shipped with Solaris 10 UR2, then please see the
    Solaris 10 Locale Patches
    page.


    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/27174/showart_217881.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP