Allow Collators to have their language specified, and specify it for tests.
[dcpomatic.git] / src / lib / collator.cc
index ba504fb6e62ba83dbfc6c449852c599816849cd4..8de1857abeb6c24c988f9e5b2536be94b67b2c6a 100644 (file)
@@ -36,10 +36,10 @@ using std::string;
 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) */