+namespace
+{
+
+bool CaseInsensitiveCharacterCompare( unsigned char a, unsigned char b )
+{
+ // Converts to lower case in the current locale.
+ return std::tolower( a ) == std::tolower( b );
+}
+
+/**
+ * return true if the lower cased ASCII strings are equal.
+ */
+bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b )
+{
+ bool result = false;
+ if( a.length() == b.length() )
+ {
+ result = std::equal( a.begin(), a.end(), b.begin(), CaseInsensitiveCharacterCompare );
+ }
+ return result;
+}
+
+} // anonymous namespace
+
+