


_O_n_l_i_n_e _M_a_n_u_a_l		Library	Functions	     setlocale(3)



NNNNAAAAMMMMEEEE
     setlocale - modify	and query a program's locale

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
     ####iiiinnnncccclllluuuuddddeeee <<<<llllooooccccaaaalllleeee....hhhh>>>>

     cccchhhhaaaarrrr ****sssseeeettttllllooooccccaaaalllleeee((((ccccaaaatttteeeeggggoooorrrryyyy,,,, llllooooccccaaaalllleeee))))
     iiiinnnntttt ccccaaaatttteeeeggggoooorrrryyyy;;;;
     cccchhhhaaaarrrr ****llllooooccccaaaalllleeee;;;;

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     _s_e_t_l_o_c_a_l_e selects the appropriate piece of	the program's
     locale as specified by the	_c_a_t_e_g_o_r_y and _l_o_c_a_l_e arguments.
     The _c_a_t_e_g_o_r_y argument may have the	following values (these
     names are defined in the <<<<llllooooccccaaaalllleeee....hhhh>>>> header	file):

     LC_CTYPE	    affects the	behavior of the	character han-
		    dling functions (_i_s_d_i_g_i_t, _t_o_l_o_w_e_r, etc.) and
		    the	multibyte character functions (such as
		    _m_b_t_o_w_c and _w_c_t_o_m_b).

     LC_NUMERIC	    affects the	decimal-point character	for the
		    formatted input/output functions and the
		    string conversion functions	as well	as the
		    non-monetary formatting information	returned
		    by _l_o_c_a_l_e_c_o_n_v.

     LC_TIME	    affects the	behavior of _a_s_c_f_t_i_m_e, _c_f_t_i_m_e,
		    _g_e_t_d_a_t_e and	_s_t_r_f_t_i_m_e.

     LC_COLLATE	    affects the	behavior of _s_t_r_c_o_l_l and	_s_t_r_x_f_r_m.

     LC_MONETARY    affects the	monetary formatted information
		    returned by	_l_o_c_a_l_e_c_o_n_v.

     LC_MESSAGES    affects the	behavior of _g_e_t_t_x_t, _c_a_t_o_p_e_n, _c_a_t_-
		    _c_l_o_s_e, and _c_a_t_g_e_t_s.

     LC_ALL	    names the program's	entire locale.

     Each category corresponds to a set	of databases which con-
     tain the relevant information for each defined locale.  The
     location of a database is given by	the following path,
     ////uuuussssrrrr////lllliiiibbbb////llllooooccccaaaalllleeee////_l_o_c_a_l_e/_c_a_t_e_g_o_r_y, where _l_o_c_a_l_e and _c_a_t_e_g_o_r_y
     are the names of locale and category, respectively.  For
     example, the database for the LC_CTYPE category for the
     "german" locale would be found in
     ////uuuussssrrrr////lllliiiibbbb////llllooooccccaaaalllleeee////ggggeeeerrrrmmmmaaaannnn////LLLLCCCC____CCCCTTTTYYYYPPPPEEEE.

     A value of	"C" for	_l_o_c_a_l_e specifies the default environment.

     A value of	"" for _l_o_c_a_l_e specifies	that the locale	should be
     taken from	environment variables.	The order in which the
     environment variables are checked for the various categories
     is	given below:

	  Category	 1st Env. Var.	 2nd Env. Var
	  ___________________________________________
	  LC_CTYPE:	 LC_CTYPE	 LANG






	  LC_COLLATE:	 LC_COLLATE	 LANG
	  LC_TIME:	 LC_TIME	 LANG
	  LC_NUMERIC:	 LC_NUMERIC	 LANG
	  LC_MONETARY:	 LC_MONETARY	 LANG
	  LC_MESSAGES:	 LC_MESSAGES	 LANG

     At	program	startup, the equivalent	of

	  setlocale(LC_ALL, "C")

     is	executed.  This	has the	effect of initializing each
     category to the locale described by the environment "C".

     If	a pointer to a string is given for _l_o_c_a_l_e, _s_e_t_l_o_c_a_l_e
     attempts to set the locale	for the	given category to _l_o_c_a_l_e.
     If	_s_e_t_l_o_c_a_l_e succeeds, _l_o_c_a_l_e is returned.	 If _s_e_t_l_o_c_a_l_e
     fails, a null pointer is returned and the program's locale
     is	not changed.

     For category LC_ALL, the behavior is slightly different.  If
     a pointer to a string is given for	_l_o_c_a_l_e and LC_ALL is
     given for _c_a_t_e_g_o_r_y, _s_e_t_l_o_c_a_l_e attempts to set the locale for
     all the categories	to _l_o_c_a_l_e.  The	_l_o_c_a_l_e may be a	simple
     locale, consisting	of a single locale, or a composite
     locale.  A	composite locale is a string beginning with a "/"
     followed by the locale of each category separated by a "/".
     If	_s_e_t_l_o_c_a_l_e fails	to set the locale for any category, a
     null pointer is returned and the program's	locale for all
     categories	is not changed.	 Otherwise, locale is returned.

     A null pointer for	_l_o_c_a_l_e causes _s_e_t_l_o_c_a_l_e	to return the
     current locale associated with the	_c_a_t_e_g_o_r_y.  The program's
     locale is not changed.

FFFFIIIILLLLEEEESSSS
     /usr/lib/locale/C/LC_CTYPE	 - LC_CTYPE database for the C
     locale.
     /usr/lib/locale/C/LC_NUMERIC		- LC_NUMERIC
     database for the C	locale.
     /usr/lib/locale/C/LC_TIME	 - LC_TIME database for	the C
     locale.
     /usr/lib/locale/C/LC_COLLATE		- LC_COLLATE
     database for the C	locale.
     /usr/lib/locale/C/LC_MESSAGES		- LC_MESSAGES
     database for the C	locale.
     /usr/lib/locale/_l_o_c_a_l_e/_c_a_t_e_g_o_r_y		- files	contain-
     ing the locale specific information for each locale and
     category.

SSSSEEEEEEEE AAAALLLLSSSSOOOO
     Library Functions (3):
			 ctime,	ctype, getdate,	gettxt,
			 localeconv, mbtowc, printf, strcoll,
			 strftime, strtod, strxfrm, wctomb

December 1990				TX Programmer's	Reference




