I think we have encountered a bug in iswalpha, as shown by the following program:
====
#include <locale.h>
#include <stdio.h>
#include <wctype.h>
int
main(const int argc, const char * const * const argv)
{
const char * const locale = (argc > 1 ? argv[1] : "C");
const char * const actual = setlocale(LC_ALL, locale);
if(actual == NULL) {
printf("%s locale not supported; skipped locale-dependent code\n",
locale);
return 0;
}
printf("locale set to %s: %s\n", locale, actual);
const int result = iswalpha(0xf4); // ô
printf("iswalpha(\"\xc3\xb4\") = %d\n", result);
return 0;
}
====
It returns 1 in the final printf, saying that that char is an walpha char, when I believe it is not. For comparison, glibc reports 0.
Tested on musl 1.0.3 (used in emscripten) and musl trunk on git, same result.
- Alon