]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Mention LC_CTYPE locale and c-ctype.{h,c}.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Mar 2001 15:04:45 +0000 (15:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 6 Mar 2001 15:04:45 +0000 (15:04 +0000)
doc/ChangeLog
doc/gettext.texi

index 64dc120c9a7625e664139d34a514313e832f2fb1..719bdcb9e199f64d3970f6952caea22e112d7057 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-03  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.texi (Triggering): Mention that gettext() now needs the
+       LC_CTYPE locale. Explain the possible solutions.
+
 2001-02-17  Karl Eichwalder  <keichwa@gmx.net>
 
        * gettext.texi: ISO 639 specifies language codes, not country codes.
index 2bc5d3114ba3f63fd66404f7b5e638b28d565535..20b28f2567015d43214b7238f5439e57ac8503a5 100644 (file)
@@ -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{<ctype.h>} 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{<c-ctype.h>} and @code{<c-ctype.c>} 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