|
|||||||
|
|
LOCALESection: Linux Programmer's Manual (7)Updated: 24 aprile 1993 Index Return to Main Contents NOMElocale - Descrizione del supporto multi-linguisticoSINTASSI#include <locale.h> DESCRIZIONEUn locale è un insieme di regole linguistiche e culturali che coprono campi come la lingua dei messaggi, insiemi di caratteri, convenzioni lessicografiche, ecc. Un programma deve poter determinare il suo locale e agire di conseguenza per poter essere adattato a culture diverse.L'header <locale.h> dichiara i tipi di dati, funzioni e macro utili per questo scopo. Le funzioni che vengono dichiarate sono setlocale() per impostare il locale corrente e localeconv() per ottenere informazioni sul modo di formattare i numeri. Le differenti categorie di informazioni locali di cui un programma potrebbe aver bisogno vengono dichiarate come macro. Usandole come primo argomento alla funzione setlocale() è possibile impostare uno dei seguenti locali
Se il secondo argomento a setlocale() è la stringa vuota , allora il locale di default è determinato come segue:
I valori che descrivono la formattazione locale dei numeri è dispobili in una struct lconv restituita dalla funzione localeconv(), che è così dichiarata:
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;
};
CONFORME APOSIX.1VEDERE ANCHEsetlocale(3), localeconv(3), locale(1), localedef(1) , rpmatch(3), strfmon(3), strcoll(3), strxfrm(3), strftime(3)
Index | ||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "Linuxinfor Man Pages in HTML Format: man7". See Index Page for more info about Authorship and Copyright. 1999-2008 Linuxinfor.com. No rights reserved. |