wctrans
Determines a mapping from one set of character codes to another.
wctrans_t wctrans( const char *property );
Parameters
- property
- A string that specifies one of the valid transformations.
Return Value
If the LC_CTYPE category of the current locale does not define a mapping whose name matches the property string property, the function returns zero. Otherwise, it returns a nonzero value suitable for use as the second argument to a subsequent call to towctrans.
Remarks
This function determines a mapping from one set of character codes to another.
The following pairs of calls have the same behavior in all locales, but it is possible to define additional mappings even in the "C" locale:
tolower( c ) same as towctrans( c, wctrans("towlower" ) )
towupper( c ) same as towctrans( c, wctrans( "toupper" ) )
Requirements
| Routine | Required Header | Compatibility |
|---|---|---|
| wctrans | <wctype.h> | Win 98, Win Me, Win NT, Win 2000, Win XP |
For additional compatibility information, see Compatibility in the Introduction.
Libraries
All versions of the C run-time libraries.
Example
// crt_wctrans.cpp
// compile with: /EHsc
#include <wchar.h>
#include <wctype.h>
#include <stdio.h>
#include <iostream>
int main() {
wint_t c = 'a';
printf("%d\n",c);
wctrans_t i = wctrans("toupper");
printf("%d\n",i);
wctrans_t ii = wctrans("towlower");
printf("%d\n",ii);
wchar_t wc = towctrans(c, i);
printf("%d\n",wc);
}
Output
97 1 0 65
See Also
Data Conversion Routines | setlocale | Run-Time Routines and .NET Framework Equivalents