I have compiled openwrt with full locale support and doing following code (which I made sure is not utf-8):
int ch_locale(Var *var)
{
#if HAVE_SETLOCALE
const char *lang;
#define tf_setlocale(cat, name, value) \
do { \
lang = setlocale(cat, value); \
if (lang) { \
eprintf("%s category set to \"%s\" locale.", name, lang); \
} else { \
eprintf("Invalid locale for %s.", name); \
} \
} while (0)
tf_setlocale(LC_CTYPE, "LC_CTYPE", "");
tf_setlocale(LC_TIME, "LC_TIME", "");
eprintf("testing isprint: äåöÄÖÅ: %d%d%d%d%d%d %d%d %d %d", isprint((int)'ä'), isprint((unsigned int)('ö')), isprint((unsigned int)'å'), isprint((unsigned char)'Ä'), isprint((unsigned char)('Å')), isprint('Å'), 1,0, (unsigned int)'ä', toupper('ä'));
---
And I get following output:
% LC_CTYPE category set to "C" locale.
% LC_TIME category set to "C" locale.
% testing isprint: äåöÄÖÅ: 000000 10 228 228
/set LC_CTYPE=fi_FI
% LC_CTYPE category set to "fi_FI.ISO-8859-1" locale.
% LC_TIME category set to "C" locale.
% testing isprint: äåöÄÖÅ: 000000 10 228 228
/set LC_CTYPE=fi_FI@euro
% LC_CTYPE category set to "fi_FI.ISO-8859-15@euro" locale.
% LC_TIME category set to "C" locale.
% testing isprint: äåöÄÖÅ: 000000 10 228 228
/set LC_CTYPE=fi_FI.ISO-8859-1
% LC_CTYPE category set to "fi_FI.ISO-8859-1" locale.
% LC_TIME category set to "C" locale.
% testing isprint: äåöÄÖÅ: 000000 10 228 228
So it seems I'm doing something wrong somewhere, any idea where my error is? Hoping it is something obvious as I'm not great linux coder expert...