/* wctob example */ #include <wchar.h> #include <stdio.h> int main() { int i,num; const wchar_t wcs [] = L"wctob example"; num=0; for (i=0; i<wcslen(wcs); ++i) if (wctob(wcs[i]) != EOF) ++num; wprintf (L"wcs contains %d characters that translate to single-byte characters.",num); return 0; } |
wcs contains 14 characters that translate to single-byte characters. |
btowc | 将单字节字符转换为宽字符(function ) |
wcrtomb | 转换宽字符为多字节序列(function ) |
wcsrtombs | 转换宽字符字符串多字节字符串(function ) |