Even when a specific locale is set, it can only support ANSI, since the value must be representable as an unsigned char.
To do anything like the "right answer" in a Unicode world, you need to cast to wide int (wint_t) and call iswalpha, which is likely to be almost as broken. A thing that happens is that C libraries will rely on OS locale character set definitions, which in turn won't be installed except for those languages that are installed. You don't want Armenian Linux? Well guess you can't tell what's punctuation vs what's a letter anymore.