Format
#include <string.h> size_t strxfrm(char *str1, const char *str2, size_t n);
Language Level: ANSI, XPG4
strxfrm transforms the string pointed to by str2 and
places the resulting string into the array pointed to by str1.
The transformation is determined by the program's locale. The
transformed string may not be displayable or printable, but can
be used with the strcmp or strncmp functions.
The result of applying strcoll to two separate strings before their transformation is equal to the result of applying strcmp, or strncmp, to the same two strings after their transformation.
No more than n bytes are placed into the area pointed to by str1, including the terminating null byte. If n is 0, str1 can be a NULL pointer.
Return Value
strxfrm returns the length of the transformed string
(excluding the null byte). When n is 0 and str1
is a null pointer, the length returned is one less than the
number of bytes required to contain the transformed string. If an
error occurs, strxfrm function returns (size_t)-1 and sets errno
to indicate the error.
Notes:
![]()
localeconv -- Retrieve Numeric Formatting
Convention
setlocale -- Set Locale
strcmp -- Compare Strings
strcoll -- Compare Strings
strncmp -- Compare Strings
wcsxfrm -- Transform Wide-Character
String
<string.h>