Interix doesn't have btowc, but it does have mbtowc. Linux manpage also
discourages the use of btowc.
boolean is_lower = STREQ (str, "lower");
boolean is_upper = STREQ (str, "upper");
wctype_t wt;
+ wchar_t twt;
int ch;
wt = wctype (str);
for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
{
- if (iswctype (btowc (ch), wt))
+ if (mbtowc (&twt, (char *)&ch, 1) >= 0 && iswctype (twt, wt))
SET_LIST_BIT (ch);
if (translate && (is_upper || is_lower)