
Beman Dawes wrote:
* "non-ASCII" itself looks like a misleading name: see the string gPunct, defined in ascii_check.cpp
* non portable (though widely portable :-)) code:
if ( c >= 'a' && c <= 'z' ) return false; if ( c >= 'A' && c <= 'Z' ) return false; if ( c >= '0' && c <= '9' ) return false;
That was mentioned in "[inspect] Hall of Shame plus non-ASCII characters" recently.
If there aren't problems with standard library support I'd suggest replacing the above with
if ( std::isalnum( static_cast< int >( c ), std::locale::classic() ) )
Similarly for the subsequent isspace-like tests
You need to read the discussion.
Done now. But to be honest I don't understand why you pointed me to it. Anyway,
isalnum isn't what we want for source files, and whatever we settle on isn't going to be locale dependent.
I didn't mean isalnum *alone*. It was meant to replace just the tests I quoted. And I specified std::locale::classic() (aka "C" locale). This just to set the records straights, as the whole affair is no big deal and you are very busy with more important things. Note that I don't know how "ASCII" got in here, but if the issue is VC++ warning C4819 then it refers to the "ANSI" codepage (Windows-1252). In the end, source files should IMHO stick to the 96 characters of the basic source set. Plus carriage return :-) -- Genny