The classification functions are also generalized by the ISO C
standard. Instead of just allowing the two standard mappings, a
locale can contain others. Again, the localedef
program
already supports generating such locale data files.
wctrans
function.
wctrans
function has to be used to find out whether a named
mapping is defined in the current locale selected for the
LC_CTYPE
category. If the returned value is non-zero, you can use
it afterwards in calls to towctrans
. If the return value is
zero no such mapping is known in the current locale.
Beside locale-specific mappings there are two mappings which are guaranteed to be available in every locale:
@multitable @columnfractions .5 .5
"tolower"
@tab "toupper"
These functions are declared in `wctype.h'.
towctrans
maps the input character wc
according to the rules of the mapping for which desc is a
descriptor, and returns the value it finds. desc must be
obtained by a successful call to wctrans
.
This function is declared in `wctype.h'.
wctrans
for them.
towlower
returns the corresponding
lower-case letter. If wc is not an upper-case letter,
wc is returned unchanged.
towlower
can be implemented using
towctrans (wc, wctrans ("tolower"))This function is declared in `wctype.h'.
towupper
returns the corresponding
upper-case letter. Otherwise wc is returned unchanged.
towupper
can be implemented using
towctrans (wc, wctrans ("toupper"))This function is declared in `wctype.h'.
char
type value to a wint_t
and use it as an
argument to towctrans
calls.
Go to the first, previous, next, last section, table of contents.