WCTRANS(3C) | Standard C Library Functions | WCTRANS(3C) |
towctrans, towctrans_l, wctrans, wctrans_l - define and perform transliteration mappings
#include <wctype.h> wint_t towctrans(wint_t wc, wctrans_t desc);
wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t loc);
wctrans_t wctrans(const char * tranclass);
wctrans_t wctrans_l(const char * tranclass, locale_t loc);
The functions wctrans() and wctrans_l() are used to obtain a handle to a table that maps one set of wide characters to another. They return an object of type wctrans_t which can be used with the functions towctrans() and towctrans_l(). The valid set of classes that are available depends on the locale. The following names are valid in all locales:
The towctrans() and towctrans_l() functions convert the wide character wc based on the conversion table specified by desc.
The functions towctrans_l() and wctrans_l() are equivalent to the functions towctrans() and wctrans(), but instead of operating in the current locale, they operate on the locale specified by loc.
On successful completion, towctrans() and towctrans_l() functions return the character that corresponds to the argument passed through the mapping table described by desc. Otherwise, they return the character unchanged and set errno. On successful completion, wctrans() and wctrans_l() functions return a non-zero identifier for tranclass. On failure, they return zero and set errno.
The wctrans() and wctrans_l() functions will fail if:
The towctrans() and towctrans_l() functions will fail if:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Standard |
MT-Level | MT-Safe |
newlocale(3C), setlocale(3C), towlower(3C), towupper(3C), environ(7), locale(7)
June 25, 2014 | OmniOS |