Wide-Character String Manipulation

Manipulate wide character strings.

#include <wchar.h>
wchar_t * wcscat(wchar_t * dst, const wchar_t * src);
wchar_t * wcschr(const wchar_t * str, const wchar_t chr);
int wcscmp(const wchar_t * str1, const wchar_t * str2);
int wcscoll(const wchar_t *str1, const wchar_t * str2);
wchar_t * wcscpy(wchar_t * dst, const wchar_t * src);
size_t wcscspn(const wchar_t * str, const wchar_t * set);
size_t wcslen(const wchar_t * str);
wchar_t * wcsncat(wchar_t * dst,
const wchar_t * src, size_t n);
int wcsncmp(const wchar_t * str1,
const wchar_t * str2, size_t n);
wchar_t * wcsncpy(wchar_t * dst,
const wchar_t * src, size_t n);
wchar_t * wcspbrk(const wchar_t * str, const wchar_t * set);
wchar_t * wcsrchr(const wchar_t * str, wchar_t chr);
size_t wcsspn(const wchar_t * str, const wchar_t * set);
wchar_t * wcsstr(const wchar_t * str, const wchar_t * pat);
wchar_t * wcstok(wchar_t * str, const wchar_t * set, wchar_t ** ptr););
size_t wcsxfrm(wchar_t * str1, const wchar_t * str2, size_t n);
void * wmemchr(const void * src, int val, size_t n);
int wmemcmp(const void * src1, const void * src2, size_t n);
void * wmemcpy(void * dst, const void * src, size_t n);
void * wmemmove(void * dst, const void * src, size_t n);
void * wmemset(void * dst, int val, size_t n);

These functions operate identically to their counterpart functions in string.h. But instead of operating on character strings, these functions operate on wide character strings.

The table below matches these wide character functions to their equivalent char-based functions in string.h.
Table 1. Wide Character String Functions
Function Wide Character Equivalent
wcscat() strcat()
wcschr() strchr()
wcscmp() strcmp()
wcscoll() strcoll()
wcscpy() strcpy()
wcscspn() strcspn()
wcslen() strlen()
wcsncat() strncat()
wcsncmp( ) strncmp()
wcsncpy() strncpy()
wcspbrk() strpbrk()
wcsrchr() strrchr()
wcsspn() strspn()
wcsstr() strstr()
wcstok() strtok()
wcsxfrm() strxfrm()
wmemcmp() memcmp()
wmemchr() memchr()
wmemcpy() memcpy()
wmemmove() memmove()
wmemset() memset()