-int
-ScreensPanel::compare (string const& utf8_a, string const& utf8_b)
-{
- if (_collator) {
- UErrorCode error = U_ZERO_ERROR;
- boost::scoped_array<uint16_t> utf16_a(new uint16_t[utf8_a.size() + 1]);
- u_strFromUTF8(reinterpret_cast<UChar*>(utf16_a.get()), utf8_a.size() + 1, nullptr, utf8_a.c_str(), -1, &error);
- boost::scoped_array<uint16_t> utf16_b(new uint16_t[utf8_b.size() + 1]);
- u_strFromUTF8(reinterpret_cast<UChar*>(utf16_b.get()), utf8_b.size() + 1, nullptr, utf8_b.c_str(), -1, &error);
- return ucol_strcoll(_collator, reinterpret_cast<UChar*>(utf16_a.get()), -1, reinterpret_cast<UChar*>(utf16_b.get()), -1);
- } else {
- return strcoll(utf8_a.c_str(), utf8_b.c_str());
- }
-}
-
-