
I want to share a problem using ilexicographical_compare(). I think that ilexicographical_compare() must compare two strings in "alphabetical" order, the order letters appear in alphabet. But ilexicographical_compare() uses is_iless() to compare letters. And such comparison looks like: std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc); So, in fact, letters are compared depending on their position in a charset. It's not always match the alphabet order. Examples are Cyrillic letters "Io" and "i" (Unicode 0451 and 0456). I think the right solution is to compare like this: T1 Ch1 = std::toupper<T1>(Arg1,m_Loc); T2 Ch2 = std::toupper<T2>(Arg2,m_Loc); return std::use_facet< std::collate<typename CharType> > (m_Loc).compare(&Ch1, &Ch1 + 1, &Ch2, &Ch2 + 1);