IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

locale (7)

LOCALE(7)                  Linux Programmer's Manual                 LOCALE(7)



NAME
       locale - Description of multi-language support

SYNOPSIS
       #include<locale.h>

DESCRIPTION
       A  locale is a set of language and cultural rules.  These cover aspects
       such as language for messages, different  character  sets,  lexigraphic
       conventions,  etc.   A program needs to be able to determine its locale
       and act accordingly to be portable to different cultures.

       The header <locale.h> declares data types, functions and  macros  which
       are useful in this task.

       The  functions  it  declares are setlocale() to set the current locale,
       and localeconv() to get information about number formatting.

       There are different categories for local information  a  program  might
       need; they are declared as macros.  Using them as the first argument to
       the setlocale() function, it is possible to set one  of  these  to  the
       desired locale:

       LC_COLLATE
              This  is used to change the behaviour of the functions strcoll()
              and strxfrm(), which are used to compare strings  in  the  local
              alphabet.  For example, the German sharp s is sorted as "ss".

       LC_CTYPE
              This changes the behaviour of the character handling and classi-
              fication functions, such as isupper()  and  toupper(),  and  the
              multi-byte character functions such as mblen() or wctomb().

       LC_MONETARY
              changes the information returned by localeconv() which describes
              the way numbers are usually printed, with details such as  deci-
              mal  point versus decimal comma.  This information is internally
              used by the function strfmon().

       LC_MESSAGES
              changes the language messages are displayed in and how an affir-
              mative  or  negative  answer looks like.  The GNU C-library con-
              tains the gettext(), ngettext(), and rpmatch() functions to ease
              the  use  of these information.  The GNU gettext family of func-
              tions also obey the environment variable LANGUAGE.

       LC_NUMERIC
              changes the information used by the printf() and scanf()  family
              of  functions, when they are advised to use the locale-settings.
              This information can also be read with  the  localeconv()  func-
              tion.

       LC_TIME
              changes  the behaviour of the strftime() function to display the
              current time in a locally acceptable form; for example, most  of
              Europe uses a 24-hour clock vs. the US' 12-hour clock.

       LC_ALL All of the above.

       If  the  second  argument  to  setlocale() is empty string, "", for the
       default locale, it is determined using the following steps:

       1.     If there is a non-null environment variable LC_ALL, the value of
              LC_ALL is used.

       2.     If an environment variable with the same name as one of the cat-
              egories above exists and is non-null, its value is used for that
              category.

       3.     If  there  is a non-null environment variable LANG, the value of
              LANG is used.

       Values about local numeric formatting is made  available  in  a  struct
       lconv  returned  by  the localeconv() function, which has the following
       declaration:
       struct lconv
       {
         /* Numeric (non-monetary) information.  */

         char *decimal_point;        /* Decimal point character.  */
         char *thousands_sep;        /* Thousands separator.  */
         /* Each element is the number of digits in each group;
            elements with higher indices are farther left.
            An element with value CHAR_MAX means that no further grouping is done.
            An element with value 0 means that the previous element is used
            for all groups farther left.  */
         char *grouping;

         /* Monetary information.  */

         /* First three chars are a currency symbol from ISO 4217.
            Fourth char is the separator.  Fifth char is ' '.  */
         char *int_curr_symbol;
         char *currency_symbol; /* Local currency symbol.  */
         char *mon_decimal_point;    /* Decimal point character.  */
         char *mon_thousands_sep;    /* Thousands separator.  */
         char *mon_grouping;         /* Like 'grouping' element (above).  */
         char *positive_sign;        /* Sign for positive values.  */
         char *negative_sign;        /* Sign for negative values.  */
         char int_frac_digits;       /* Int'l fractional digits.  */
         char frac_digits;      /* Local fractional digits.  */
         /* 1 if currency_symbol precedes a positive value, 0 if succeeds.  */
         char p_cs_precedes;
         /* 1 if a space separates currency_symbol from a positive value.  */
         char p_sep_by_space;
         /* 1 if currency_symbol precedes a negative value, 0 if succeeds.  */
         char n_cs_precedes;
         /* 1 if a space separates currency_symbol from a negative value.  */
         char n_sep_by_space;
         /* Positive and negative sign positions:
            0 Parentheses surround the quantity and currency_symbol.
            1 The sign string precedes the quantity and currency_symbol.
            2 The sign string succeeds the quantity and currency_symbol.
            3 The sign string immediately precedes the currency_symbol.
            4 The sign string immediately succeeds the currency_symbol.  */
         char p_sign_posn;
         char n_sign_posn;
       };

CONFORMSTO
       POSIX.1
       The GNU gettext functions are specified in LI18NUX2000.

SEEALSO
       setlocale(3), localeconv(3), locale(1),  localedef(1),  nl_langinfo(3),
       gettext(3),    ngettext(3),    rpmatch(3),    strfmon(3),   strcoll(3),
       strxfrm(3), strftime(3)



Linux                             1993-04-24                         LOCALE(7)

LDPiso_8859-15regex
arpiso_8859-2rtnetlink
asciiiso_8859-7samples
bootiso_8859-9signal
bootparamiso_8859_1socket
capabilitiesiso_8859_15suffixes
charsetsiso_8859_2tcp
ddpiso_8859_7udp
globiso_8859_9unicode
hierkoi8-runits
icmplatin1unix
introlatin2uri
iplocaleurl
ipv6mailaddrutf-8
iso-8859-1manutf8
iso-8859-15mdocx25
iso-8859-2netdevice 
iso-8859-7netlink 
iso-8859-9packet 


ImageMagick 6.5.7.5
ImageMagick image processing studio
Krusader 2.1.0-beta1
Twin-Panel filemanager for KDE3
LilyPond 2.13.7
Music typesetter.
KDevelop 4.0 beta6
Integrated Development Environment for Unix/X11
KDE 4.3.3
Powerful Open Source graphical desktop environment.
Mandriva Linux 2010.0
Linux distribution by Mandriva
Linux Kernel 2.6 2.6.32-rc6
Linux Kernel
WebGUI 7.7.25
A fully featured content management system.
SimplyMEPIS 8.0.12
Run the Linux operating system from your CD or DVD drive
Fedora 12 rc1
Community-supported open source distribution
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info