+2023-06-19 Bruno Haible <bruno@clisp.org>
+
+ doc: Corrections to the "Strings and Characters" chapter.
+ Suggested by Paul Eggert.
+ * doc/strings.texi: Corrections: GB18030 is rarely used nowadays.
+ <ctype.h> functions can be useful for specific data.
+
2023-06-19 Bruno Haible <bruno@clisp.org>
doc: Use "spaced en dash" style instead of "spaced em dash" style.
``unibyte locale'', otherwise of a ``multibyte locale''.
It is important to realize that the majority of Unix installations
-nowadays use UTF-8 or GB18030 as locale encoding; therefore, the
+nowadays use UTF-8 as locale encoding; therefore, the
majority of users are using multibyte locales.
Three important facts to remember are:
@itemize @bullet
@item
The @posixheader{ctype.h} API, that was designed only with unibyte
-encodings in mind, is useless nowadays; it does not work in
-multibyte locales.
+encodings in mind, is useless nowadays for general text processing; it
+does not work in multibyte locales.
@item
The @posixfunc{strlen} function does not return the number of characters
in a string. Nor does it return the number of screen columns occupied
@emph{Multibyte does not imply UTF-8 encoding.}
@end cartouche
-While UTF-8 is the most common multibyte encoding, GB18030 is there as
-well and will not go away within decades, because it is a Chinese
-government standard, last revised in 2022.
+While UTF-8 is the most common multibyte encoding, GB18030 is also a
+supported locale encoding on GNU systems (mostly because it is a Chinese
+government standard, last revised in 2022).
@cartouche
@emph{Searching for a character in a string is not the same as searching
@node Iterating through strings
@subsubsection Iterating through strings
-For complex string processing, the provided strings functions may not be
+For complex string processing, the provided string functions may not be
enough, and what you need is a way to iterate through a string while
processing each (possibly multibyte) character in turn. Gnulib provides
two modules for this purpose. Both iterate through the string in
program that runs only in unibyte locales.
ISO C and POSIX standardized an API for characters of type @code{char},
-in @code{<ctype.h>}. This API is nowadays useless and obsolete.
+in @code{<ctype.h>}. This API is nowadays useless and obsolete, when it
+comes to general text processing.
The important lessons to remember are: