using std::vector;
-Collator::Collator()
+Collator::Collator(char const* locale)
{
UErrorCode status = U_ZERO_ERROR;
- _collator = ucol_open(nullptr, &status);
+ _collator = ucol_open(locale, &status);
if (_collator) {
ucol_setAttribute(_collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
/* Ignore case and character encoding (and probably some other things) */
BOOST_AUTO_TEST_CASE(collator_compare_works_and_ignores_case)
{
- Collator collator;
+ Collator collator("en");
BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even NOTiCE"), 0);
BOOST_CHECK_EQUAL(collator.compare("So often YOU won't even notice", "SO OFTEN you won't even see"), -1);
BOOST_AUTO_TEST_CASE(collator_search_works_and_ignores_case)
{
- Collator collator;
+ Collator collator("en");
BOOST_CHECK(collator.find("outh", "With filthy mouths, and bad attitudes"));
BOOST_CHECK(collator.find("with", "With filthy mouths, and bad attitudes"));