没遇到过 网上找的 你看看
Though this call is late I just encountered the same problem again; I guess 101st times now.
As I see it, many developers seem to run into this problem and the statement that passing a value larger than 255 is not allowed for isctype.c may be correct so far but the circumstances that lead to it seem to be a problem made by Microsoft itself.
E.g. I have a mutithreaded program in debug, i.e. compiled with _DEBUG and _MT compiler switches, and I use some of the isspace, isdigit, is... CRT functions in my program. All of these functions have a signature specifying to accept an integer as only parameter and therefore I claim to use it as integer to test whatever (unicode) character to be a digit, a space or whatsoever.
Now, if I run this program testing any arabic, kyrillic, chinese character the beforementioned assertion will come up. In release the program will state a protection fault. If you take a look at the CRT implementation you will find that it is not supported for multithreading but still the CRT itself (not my program) refers it. So as a developer I have no chance to work around it (and it really should not be my task to work around it).
#if !defined (_MT) || defined (_DEBUG)
int __cdecl _chvalidator(
int c,
int mask
)
{
_ASSERTE((unsigned)(c + 1) <= 256);
return ( _pctype[c] & mask);
}
Addenum:
There may be of course the possibility to use the isw... functions but I am not quite sure if these are supported in the ANSI standard - and therefore may not be available on non-Windows platform compilers.