Skip Navigation Links | |
Exit Print View | |
International Language Environments Guide for Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library |
2. Unicode and UTF-8 Locale Support
3. Working with Languages and Locales
4. Desktop Keyboard Preferences and Input Methods
International Components for Unicode
Auto Encoding Finder (auto_ef)
Internationalized Domain Name Support
Interoperability with Other Platforms
This section describes how to create a custom locale based on an existing locale delivered with the system using localedef(1).
Note - Only the locales provided by Oracle are supported. A badly formed locale can be a source of failures.
To customize and thus create a new locale from existing locales, you need to prepare at least three locale definition source files:
localedef source file – Contains necessary definitions for the locale.
charmap source file – Contains mappings between code point values and human-readable symbolic names. The symbolic names are used in the localedef source file. The charmap source file also contains other definitions, such as the codeset name of the locale, the maximum number of bytes that can be represented in a locale code point, and so on.
extension source file – Contains mappings of standard interfaces such as strcoll(3C) and fgetwc(3C) to internal locale methods, and other information needed for the proper operation of the locale.
The locales provided by the system have their respective locale definition data files available in source/locale/localedef package. These can be useful when only a slight change in existing system locale is required.
$ sudo pkg install system/header source/locale/localedef
$ export PATH=<oracle-studio-path>/bin:$PATH
$ mkdir mynewlocale $ cd mynewlocale $ mkdir amd64 $ cp /usr/lib/locale/common/methods_unicode.so.3 . $ cp /usr/lib/locale/common/amd64/methods_unicode.so.3 amd64/ $ cp /usr/lib/localedef/src/charmaps/UTF-8.charmap \ /usr/lib/localedef/src/extensions/UTF-8.x \ /usr/lib/localedef/src/locales/fr_FR.UTF-8.src .
$ localedef -m lp64 -f UTF-8.charmap -x UTF-8.x -i fr_FR.UTF-8.src \ -L "-R\\\$ORIGIN/../../common -Bdirect -M /usr/lib/ld/map.pagealign \ -M /usr/lib/ld/map.noexdata" fr_FR.UTF-8@custom $ mv fr_FR.UTF-8@custom.so.3 amd64/
$ localedef -m ilp32 -f UTF-8.charmap -x UTF-8.x -i fr_FR.UTF-8.src \ -L "-R\\\$ORIGIN" fr_FR.UTF-8@custom
$ sudo mkdir -p /usr/lib/locale/fr_FR.UTF-8\@custom/amd64 $ sudo cp fr_FR.UTF-8\@custom.so.3 /usr/lib/locale/fr_FR.UTF-8\@custom/ $ sudo cp amd64/fr_FR.UTF-8\@custom.so.3 /usr/lib/locale/fr_FR.UTF-8\@custom/amd64/
$ export LANG=fr_FR.UTF-8@custom
Creating a locale from scratch is something that is rarely needed. The same approach as in the Creating a New Locale Based on a System Locale can be used to create a locale from scratch. Refer the localedef(1), locale(5), extensions(5) and charmap(5) man pages for more detailed information on locales and options available for the localedef, charmap and extension source files.