19 lines
349 B
C
19 lines
349 B
C
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <locale.h>
|
||
|
|
||
|
char src[] = { "A sample STRING" };
|
||
|
char dst[20];
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
char *prev_locale;
|
||
|
size_t len;
|
||
|
|
||
|
/* set native locale */
|
||
|
prev_locale = setlocale( LC_ALL, "" );
|
||
|
printf( "%s\n", prev_locale );
|
||
|
len = strxfrm( dst, src, 20 );
|
||
|
printf( "%s (%u)\n", dst, len );
|
||
|
}
|