On Tue, 26 Sep 2000, Mark Leisher wrote:
> : if isUpper c
> : c := toLower c
> Thomas> This code seems quite strange to me...
> I recall that this code fragment was used for implementations that were flawed
> in some way. I know many earlier versions of SunOS had this problem.
Actually, the root problem is that the definition of C's tolower() has
*changed* over time. Originally it was defined to be valid only on
uppercase letters. The implementation exploited the fact that the input
value was known to be uppercase; it simply added the known offset between
ASCII uppercase and lowercase letters. If you wanted a function that
converted uppercase to lowercase but left everything else alone, you had
to implement the "leave everything else alone" part yourself. Eventually
it became clear that such a function was what everyone really wanted, and
tolower() was redefined to do that. (A stupid move -- they should have
changed the name when they changed the behavior.)
Henry Spencer
[EMAIL PROTECTED]
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/