wctrans(3) Library Functions Manual wctrans(3)NAME
wctrans - Maps wide characters to a property
LIBRARY
Standard C Library (libc)
SYNOPSIS
#include <wctype.h>
wctrans_t wctrans(
const char *property);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
wctrans(): XSH5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Identifies a definition that maps one wide character to another in the LC_TYPE category of a locale.
DESCRIPTION
The wctrans() function constructs a wctrans_t value that maps wide characters in the current locale according to the specified property.
Because all locales include ASCII letter characters through the Portable Character Set and because you can apply case conversion to ASCII
letter charaters, two properties that are valid for all locales are toupper and tolower.
After a successful call to the wctrans() function to map associated characters according to a specified property, you can call the towc-
trans() function to convert characters according to this property. Refer to the towctrans(3) reference page for an example that uses these
functions.
RESTRICTIONS
Currently, tolower and toupper are the only supported values for property. Defining additional properties in locales requires an extension
to the localedef utility. The rules for implementing this extension are not yet available in current issues of the industry standards that
apply to this utility.
RETURN VALUES
If property identifies a wide-character mapping that is defined in the LC_CTYPE category of the current locale, the wctrans() function
returns a nonzero value that is valid as the second argument of the towctrans() function; otherwise, the wctrans() function returns zero.
RELATED INFORMATION
Commands: localedef(1)
Functions: iswctype(3), towctrans(3), wctype(3)
Files: locale(4) delim off
wctrans(3)
Check Out this Related Man Page
WCTRANS(3) BSD Library Functions Manual WCTRANS(3)NAME
towctrans, towctrans_l, wctrans, wctrans_l -- wide character mapping functions
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <wctype.h>
wint_t
towctrans(wint_t wc, wctrans_t desc);
wctrans_t
wctrans(const char *charclass);
#include <wctype.h>
#include <xlocale.h>
wint_t
towctrans_l(wint_t wc, wctrans_t desc, locale_t loc);
wctrans_t
wctrans_l(const char *charclass, locale_t loc);
DESCRIPTION
The wctrans() function returns a value of type wctrans_t, which represents the requested wide character mapping operation and may be used as
the second argument for calls to towctrans().
The following character mapping names are recognised:
tolower toupper
The towctrans() function transliterates the wide character wc, according to the mapping described by desc.
While the towctrans() and wctrans() functions use the current locale, the towctrans_l() and wctrans_l() functions may be passed locales
directly. See xlocale(3) for more information.
RETURN VALUES
The towctrans() function returns the transliterated character if successful, otherwise it returns the character unchanged and sets errno.
The wctrans() function returns non-zero if successful, otherwise it returns zero and sets errno.
EXAMPLES
Reimplement towupper() in terms of towctrans() and wctrans():
wint_t
mytowupper(wint_t wc)
{
return (towctrans(wc, wctrans("toupper")));
}
ERRORS
The towctrans() function will fail if:
[EINVAL] The supplied desc argument is invalid.
The wctrans() function will fail if:
[EINVAL] The requested mapping name is invalid.
SEE ALSO tolower(3), toupper(3), wctype(3), xlocale(3)STANDARDS
The towctrans() and wctrans() functions conform to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
The towctrans() and wctrans() functions first appeared in FreeBSD 5.0.
BSD October 3, 2002 BSD