From 46c7ddd9a8cdc941b4efd49d24926f60bba1bafa Mon Sep 17 00:00:00 2001 From: "cira@chromium.org" Date: Wed, 25 May 2011 22:18:41 +0000 Subject: [PATCH] Landing http://codereview.chromium.org/7033038 for jshin. Make 'ignoreCase' work in collator. BUG=28604 TEST=http://www.i18nl10n.com/chrome/coll.html Review URL: http://codereview.chromium.org/7008023 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8066 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/extensions/experimental/collator.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/extensions/experimental/collator.cc b/src/extensions/experimental/collator.cc index 7d1a21d..bd5bdeb 100644 --- a/src/extensions/experimental/collator.cc +++ b/src/extensions/experimental/collator.cc @@ -153,6 +153,11 @@ v8::Handle Collator::JSCollator(const v8::Arguments& args) { bool ignore_case, ignore_accents, numeric; if (ExtractBooleanOption(options, "ignoreCase", &ignore_case)) { + // We need to explicitly set the level to secondary to get case ignored. + // The default L3 ignores UCOL_CASE_LEVEL == UCOL_OFF ! + if (ignore_case) { + collator->setStrength(icu::Collator::SECONDARY); + } collator->setAttribute(UCOL_CASE_LEVEL, ignore_case ? UCOL_OFF : UCOL_ON, status); if (U_FAILURE(status)) { -- 2.7.4