Use tolower()/toupper()/isupper() from ctype.h
This was suggested by Rick and my initial answer was but it is locale aware, so a) it will mess the names when in non-POSIX locale and b) it must be slower.
Turns out that a) can be easily fixed (any program that doesn't call setlocale()
is running with POSIX locale) and b) isn't true. In fact, using the tolower()
was fastest out of all the implementations we used or considered.