logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Using the syslog appender in log4cxx
Date Fri, 06 Jun 2008 16:36:38 GMT

On Jun 6, 2008, at 10:51 AM, Dale King wrote:

> OK, I see now why it is only cosmetic. It only ends up being that way
> because the strings differ only in a character that is not a letter.
> That is a cumbersome way to do case insensitive comparison. It would
> be a lot easier to lose the third parameter and do:
> if (arg1.size() != arg2.size() ) return false;
> for(int i = 0; i < arg1.size(); i++) {
> if (apr_toupper( arg1[i] ) != apr_toupper( arg2[i] ) ) return false;
> }
> (using apr_toupper for maximum portability). This could have problems
> if you were trying to compare against accented or foreign characters,
> but I think you are only comparing against ASCII.

That approach could have problems with the letter "i" due to the  
Turkish i problem (http://en.wikipedia.org/wiki/Turkish_dotted_and_dotless_I 
) which did affect log4j (https://issues.apache.org/bugzilla/show_bug.cgi?id=40937 
).  It seemed easier to just avoid the whole locale sensitivity of  
case changing strings that contain "i" using the RTL and just hard  
code the expected uppercase and lowercase versions.

View raw message