diff options
author | roubert@google.com <roubert@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 18:43:33 +0000 |
---|---|---|
committer | roubert@google.com <roubert@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 18:43:33 +0000 |
commit | 9c30db38c00980cb9b41c2f5a448df5d05c55e4e (patch) | |
tree | 2be2b774dde043fc7b91add8fde2c196fbe2db84 /third_party | |
parent | 93fb8d62c59110217374d6383b2b46ad6524d670 (diff) | |
download | chromium_src-9c30db38c00980cb9b41c2f5a448df5d05c55e4e.zip chromium_src-9c30db38c00980cb9b41c2f5a448df5d05c55e4e.tar.gz chromium_src-9c30db38c00980cb9b41c2f5a448df5d05c55e4e.tar.bz2 |
Use the root locale instead of the system default locale.
ChromeStringCanonicalizer does case and diacritic insensitive string
comparison through an ICU Collator. To get general Unicode character
rules, the root locale should be used. The system default locale is
different from system to system, and using that will cause the code to
break when executed on a system where it doesn't have the properties
that this code assumes.
This change also adds #include statemens for all ICU header files from
which the code in this file uses declarations.
R=rouslan@chromium.org
BUG=
Review URL: https://codereview.chromium.org/275913002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/libaddressinput/chromium/canonicalize_string.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/third_party/libaddressinput/chromium/canonicalize_string.cc b/third_party/libaddressinput/chromium/canonicalize_string.cc index b6d9928..3bb8c92 100644 --- a/third_party/libaddressinput/chromium/canonicalize_string.cc +++ b/third_party/libaddressinput/chromium/canonicalize_string.cc @@ -6,6 +6,10 @@ #include "base/logging.h" #include "cpp/include/libaddressinput/util/scoped_ptr.h" +#include "third_party/icu/source/common/unicode/errorcode.h" +#include "third_party/icu/source/common/unicode/locid.h" +#include "third_party/icu/source/common/unicode/unistr.h" +#include "third_party/icu/source/common/unicode/utypes.h" #include "third_party/icu/source/i18n/unicode/coll.h" namespace i18n { @@ -17,7 +21,9 @@ class ChromeStringCanonicalizer : public StringCanonicalizer { public: ChromeStringCanonicalizer() : error_code_(U_ZERO_ERROR), - collator_(icu::Collator::createInstance(error_code_)) { + collator_( + icu::Collator::createInstance( + icu::Locale::getRoot(), error_code_)) { collator_->setStrength(icu::Collator::PRIMARY); DCHECK(U_SUCCESS(error_code_)); } |