|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 2755 (0xac3) Types: TextFile Names: »setlocale.3«
└─⟦276d19d6e⟧ Bits:30007243 EUUGD5_I: X11R5 └─⟦4856bf7e7⟧ »./mit-4/mit-4.00« └─⟦635ff9e7e⟧ └─⟦this⟧ »mit/doc/I18N/Xsi/Xlc/setlocale.3«
.\" $Header: setlocale.3,v 1.2 91/02/04 09:44:05 morisaki Exp $ .\" $Date: 91/02/04 09:44:05 $ .\" Copyright 1990, 1991 by OMRON Corporation. .\" Copyright 1991 by the Massachusetts Institute of Technology. .TH Xlocale 3X11 "" "December, 1990" .SH NAME .B setlocale \- set or query the current locale. .SH SYNOPSIS .br #include <X11/Xlocale.h> .PP .B char *setlocale\f2(locale_category, locale_name)\f3 .br .B int \f2locale_category\f3; .br .B char \f2*locale_name\f3; .br .SH DESCRIPTION .PP The setlocale sets the current locale for the specified category. If the operation was successful, setlocale returns a pointer to the current locale name for the category If the category is invalid or the locale is not supported in the system, setlocale returns a NULL pointer. The returned locale name is owned by the system locale, do not change or free it. .PP The category is defined to one of the following: .IP "" " " XLC_CODESET .br XLC_FONTSET .br XLC_INPUTMETHOD .br XLC_ALL .PP The XLC_ALL lets setlocale to set all categories to the locale_name. .PP The locale name is allowed to the form: .IP "" " " NULL .br "" .br string .PP The value NULL means to query the current locale name, and setlocale returns the locale name string. .PP The empty string sets the implementation-depedent locale. It examines the enviroment $LANG. If ${LANG} is set and con- tains the name of a valid locale, that value is used to set category. If the value is still not obtained, setlocale sets the category to C-language "C" and return the locale name. The C locale is ASCII codeset. .PP The locale name is accepted to the following form: .IP "" " " language[_territory[.codeset]] .PP The language and territory are country codes defined in ISO standard. .PP The string of locale name is allowed to a colon-separated list of locale name: .IP "" " " locale1:locale2:...:localeN .PP or one locale name .IP "" " " locale .PP This form is equal to locale:locale:...:localeN .PP which is ordered to the following sequence of categories: .IP "" " " XLC_CODESET:XLC_FONTSET:XLC_INPUTMETHOD .PP Correspondently, the setting XLC_ALL accepts this string form. If the number N is less than the actual total number of categories, setlocale() sets the remaining categories to the last one localeN, so one locale name for XLC_ALL is just a case of this form. This colon-separated string can help to restore an original locale for all categories. .PP For example: .IP "" " " oldlocale = strdup(setlocale(XLC_ALL, NULL)); .br /* do something that might change locale for all .br .br * or some categories. .br */ .br setlocale(XLC_ALL, oldlocale); .PP The function returns the locale name to have been set. If the locale name is not correct, return NULL.