From: Bruno Haible Date: Tue, 6 Mar 2001 15:04:45 +0000 (+0000) Subject: Mention LC_CTYPE locale and c-ctype.{h,c}. X-Git-Tag: v0.10.36~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f452325cd0ab9d50337c0259c5e7c2536c1b626f;p=thirdparty%2Fgettext.git Mention LC_CTYPE locale and c-ctype.{h,c}. --- diff --git a/doc/ChangeLog b/doc/ChangeLog index 64dc120c9..719bdcb9e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2001-03-03 Bruno Haible + + * gettext.texi (Triggering): Mention that gettext() now needs the + LC_CTYPE locale. Explain the possible solutions. + 2001-02-17 Karl Eichwalder * gettext.texi: ISO 639 specifies language codes, not country codes. diff --git a/doc/gettext.texi b/doc/gettext.texi index 2bc5d3114..20b28f256 100644 --- a/doc/gettext.texi +++ b/doc/gettext.texi @@ -1394,7 +1394,7 @@ code above by a sequence of @code{setlocale} lines @group @{ @dots{} - setlocale (LC_TIME, ""); + setlocale (LC_CTYPE, ""); setlocale (LC_MESSAGES, ""); @dots{} @} @@ -1402,13 +1402,26 @@ code above by a sequence of @code{setlocale} lines @end example @noindent -or to switch for and back to the character class in question. On all -POSIX conformant systems the locale categories @code{LC_CTYPE}, +On all POSIX conformant systems the locale categories @code{LC_CTYPE}, @code{LC_COLLATE}, @code{LC_MONETARY}, @code{LC_NUMERIC}, and @code{LC_TIME} are available. On some modern systems there is also a locale @code{LC_MESSAGES} which is called on some old, XPG2 compliant systems @code{LC_RESPONSES}. +Note that changing the @code{LC_CTYPE} also affects the functions +declared in the @code{} standard header. If this is not +desirable in your application (for example in a compiler's parser), +you can use a set of substitute functions which hardwire the C locale, +such as found in the @code{} and @code{} files +in the gettext source distribution. + +It is also possible to switch the locale forth and back between the +environment dependent locale and the C locale, but this approach is +normally avoided because a @code{setlocale} call is expensive, +because it is tedious to determine the places where a locale switch +is needed in a large program's source, and because switching a locale +is not multithread-safe. + @node Mark Keywords, Marking, Triggering, Sources @section How Marks Appears in Sources