STRXFRM(3)

NAME
strxfrm, strxfrm_l - transform a string under locale

SYNOPSIS
#include <string.h>
size_t
strxfrm(char *dst, const char *src, size_t n);
#include <xlocale.h>
size_t
strxfrm_l(char *dst, const char *src, size_t n, locale_t l);

DESCRIPTION
The idea of strxfrm() and strxfrm_l() is to “un-localize” a string: those function transform src, storing the result in dst, such that strcmp(3) on transformed strings returns what strcoll(3) on the original untransformed strings would return.

n is the maximal amount of bytes that can be written to dst , however if n is 0 this function returns the amount of bytes that the transformed string would require --usefull to allocate space before calling again.

The function strcoll() uses the current locale collation, while strcoll_l() uses the given locale, see xlocale(3)

RETURN VALUE
Length of the string transformed (not counting NUL). If such lenght is grather than n the contents of dst is unspecified.

SEE ALSO
bcmp(3), memcmp(3), setlocale(3), strcasecmp(3), strcmp(3), xlocale(3), strcoll(3)

STANDARDS
The strxfrm() function conforms to ansiC.

HISTORY
The implementation is derived from FreeBSD

BUGS
The current implementation is enough only for single byte encodings and UTF-8 translatable to ISO8859-1.