[net.sources] CORRECT soundex AGAIN? not quite

ian@sq.UUCP (09/19/86)

	> >		if (isalpha(*name)) {
	> First you should test isascii(*name) (a nit).

	Um, isalpha() returns false for all non-ASCII characters already.
Chris is not nitpicking, and you are not correct. See below.

	> >			lc = tolower(*name);
	> Watch out!  Some tolower()s fail miserably if !isupper(c).

	I should have said my code conforms to the SVID; according to
	it and all other stds, tolower(c) will always work correctly.

You are, I fear, hoist by your own petard. We have long maintained
that the ctype macros are ONLY valid if isascii() is
true for the character. Well, guess what? The SVID supports us!
For everyone's edification, here is the official specification:
	``The function isascii is defined on all integer values;
	THE REST ARE DEFINED ONLY WHERE ISASCII IS TRUE and on 
	the single non-ASCII value EOF,'' [defined in stdio.h]
		SVID, Issue 2, Vol 1, p 165. [emphasis added]
In fact, similar wording is found in most all UNIX manuals (V7, SIII,
4.2, SV).  We feel strongly about this because we once spent several
person-weeks debugging the amazing Sendmail program on a non-4.2
system - the problem resolved to Sendmail's incorrect use of ctype 
macros without isascii().

Ian Darwin
Toronto, Canada