[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - i18npool/source
Andras Timar (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 19 09:46:37 UTC 2020
i18npool/source/collator/collator_unicode.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 7d932fa99219e2395e169941f96f94452c2f6bb6
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Fri Jun 19 11:05:36 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 19 11:46:04 2020 +0200
Fix a chrash in LOKit (Japanese-only)
Change-Id: I09c8d3a129c0d1d2fab561add0447869156b193f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96682
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index b731d8879fed..c9d696fc6046 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -393,6 +393,11 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale),
"", rAlgorithm.isEmpty() ? OUString("") : "collation=" + rAlgorithm));
+ // FIXME: apparently we get here in LOKit case only. When the language is Japanese, we pass "ja at collation=phonetic (alphanumeric first)" to ICU
+ // and ICU does not like this (U_ILLEGAL_ARGUMENT_ERROR). Subsequently LOKit crashes, because collator is nullptr.
+ if (!strcmp(icuLocale.getLanguage(), "ja"))
+ icuLocale = icu::Locale::getJapanese();
+
// load ICU collator
collator.reset( static_cast<icu::RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) ) );
if (! U_SUCCESS(status)) {
More information about the Libreoffice-commits
mailing list