6.20.24 strxfrm Function

Transforms a string using the locale-dependent rules.

Include

<string.h>

Prototype

size_t strxfrm(char * restrict s1, const char * restrict s2, size_t n);

Arguments

s1
destination string
s2
source string to be transformed
n
number of characters to transform

Return Value

Returns the length of the transformed string not including the terminating null character. If n is zero, the string is not transformed (s1 may be a point null in this case) and the length of s2 is returned.

Remarks

The function transforms a string such that if two transformed strings are compared using strcmp, the result would be the same as comparing the original strings using the strcoll function. As no locales other than the "C" locale are supported, the transformation is equivalent to strcpy, except that the length of the destination string is bounded by n-1.