Previous Page
Next Page

towctrans

Performs a locale-specific conversion on a wide character

#include <wctype.h>
wint_t towctrans ( wint_t wc , wctrans_t desc  );

The towctrans( ) function returns a wide character that corresponds to the wide character value of its first argument, wc, according to a locale-specific mapping described by the second argument, desc. Values of desc are obtained by calling the wctrans( ) function. The behavior of both wctrans( ) and towctrans( ) is dependent on the locale setting of the category LC_CTYPE, which must not change between the two function calls.

Example

wint_t before = L'\0', after = L'\0';
wctrans_t mapping;
mapping = wctrans("toupper");

while (( before = getwchar( ) ) != WEOF )
{
  after = towctrans( before, mapping );
  putwchar( after );
  if ( after == L'Q' )
    break;
}

See Also

wctrans( ), towlower( ), towupper( )


Previous Page
Next Page