Format
#include <wchar.h> size_t wcsxfrm (wchar_t *wcs1, const wchar_t *wcs2, size_t n);
Language Level: XPG4
Threadsafe: Yes.
Description
The wcsxfrm() function transforms the wide-character string pointed to by wcs2 to values which represent character collating weights and places the resulting wide-character string into the array pointed to by wcs1.
Return Value
The wcsxfrm() function returns the length of the transformed wide-character string (not including the ending null wide character code). If the value returned is n or more, the contents of the array pointed to by wcs1 are indeterminate.
If wcsxfrm() is unsuccessful, errno is changed. The value of errno may be set to EINVAL (the wcs1 or wcs2 arguments contain characters which are not available in the current locale).
Example that uses wcsxfrm()
#include <stdio.h> #include <wchar.h> int main(void) { wchar_t *wcs; wchar_t buffer[80]; int length; printf("Type in a string of characters.\n "); wcs = fgetws(buffer, 80, stdin); length = wcsxfrm(NULL, wcs, 0); printf("You would need a %d element array to hold the wide string\n", length); printf("\n\n%S\n\n transformed according", wcs); printf(" to this program's locale. \n"); }
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.