Hi, >>>>> Csaba Raduly wrote: > If the type of those members is WCHAR[] then using isascii() / > isupper() on them is just plain wrong. > The correct function to use would be iswupper().
I agree that isw*() functions should be used for wchar_t. But I think just changing isupper() to iswupper() is not enough as I explain below. If iswascii() was available, using both iswascii() and iswupper() might be a candidate. > The line > if (isupper(*src)) *dst++ = *src; > (where src is wchar_t* and dst is char*) assumes that the upper 8 bits > of *src are zero (or *src is -1). > If not, the behavior is at best implementation-defined (maybe even undefined). With Japanese Windows, the upper 8 bits of *src are not zero. So I would like to correct the behavior. I think adding isascii() can be a compromise. >> 1. Using iswupper() instead of isupper(). >> - Although this method is effective for Japanese environments, it >> is not assured that the character iswupper() returns true fits in >> the range of ASCII. > It is highly likely that if the argument of iswupper() does not fit > into ASCII then its result won't fit either. I'm not sure if I understand what you are saying, but for example iswupper(L'\uff21') returns 1 in Japanese locale. Regards, KOBAYASHI Shinji. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple