Next Previous Contents

9.

, , . , , , , . , . , .

, , . , ; , , .

, . .

c : localization internationalization. , . . - //. , - ... , . , - , : "" () . , .

( i18n ), , , , .

, , .

, ; .

. , .

9.1 Locale

- locale. locale , . , locale . , locale- / / . , / - / / , / - / / .

Locale

locale - , :

  1. ( . )
  2. /

RedHat Linux ( Linux), locale: C (libc), X . locale .

locale , LANG. , sh:

LANG=ru_SU
export LANG

, date. , .

RedHat 5.x KOI8-R locale ru_SU, . ru_RU locale iso-8859-5 .

, locale . , ( ) ru_SU locale, POSIX . , , locale. :

LANG=ru_SU
LC_NUMERIC=POSIX
export LANG LC_NUMERIC

, . locale(7).

Linux. , Linux libc 5.3.12, RedHat 4.1 locale. Interneta (, , ).

, locale, 'locale -a'. locale libc.

X, locale. (XFree86 3.3), locale. . , , /usr/lib/X11/locale/ ( ). , , koi8-r iso8859-5..

Locale

locale , . , API, , locale. , , locale - , locale ( ).

man setlocale(3):

locale, setlocale(LC_ALL, "" ) , , localeconv() locale - strcoll() strxfrm() .

:

  1. 8 . setlocale(). - 8- , ctype.h limits.h, signed/unsigned . , - . :
        if (c >= 'A' && c <= 'Z') {
            ...
    
    
    
    
                      ,
      locale    ctype.h.
    
  2. , , . strcoll() strxfrm() strcmp() , time(), localtime(), strftime() , , localeconv() .
  3. /. . . , . , gettext() (Sun/POSIX ), catgets() (X/Open ). . i18n .
  4. EUC/Unicode . , char. wchar_t, , , Unicode. ANSI C API.

, ( Voropay1 ) ( SingleUnix ).

9.2

, , ( i18n ) - .

, , . , ( ) . , , free !

GNU . Ulrich Drepper (drepper@ipd.info.uni-karlsruhe.de) gettext. GNU , prep.ai.mit.edu. , . , , gettext .

: gettext GNU , ! GNU , locale . , ( , ). , : .po , , . , , ! Ulrich Drepper ( drepper@ipd.info.uni-karlsruhe.de).


Next Previous Contents