PIM: use higher collation level

Now also pay attention to case and punctuation. Previously these were
ignored for performance reasons. The reasoning that case doesn't
matter was wrong, it is useful as a tie breaker (which is what the
higher level does).
This commit is contained in:
Patrick Ohly 2013-05-14 21:38:09 +02:00
parent 2ced6a51d5
commit 74515d4061
1 changed files with 7 additions and 4 deletions

View File

@ -48,12 +48,15 @@ SE_BEGIN_CXX
*
* The drawback of higher levels is that they are computationally more
* expensive (transformation is slower and leads to longer transformed
* strings, thus a longer string comparisons during compare) and may
* end up comparing aspects that are irrelevant (like case).
* strings, thus a longer string comparisons during compare).
*
* The default here pays attention to accents, but ignores the case.
* The default here pays attention to accents, case, and
* punctuation. According to
* http://userguide.icu-project.org/collation/concepts, it is required
* for Japanese.
*/
static const boost::locale::collator_base::level_type DEFAULT_COLLATION_LEVEL = boost::locale::collator_base::secondary;
static const boost::locale::collator_base::level_type DEFAULT_COLLATION_LEVEL =
boost::locale::collator_base::quaternary;
class CompareBoost : public IndividualCompare, private boost::noncopyable {
std::locale m_locale;