GError::message is UTF-8
commita93c3f2eb07fc15d1ebb0fd70ab58ecea27bd4f1
authorStephan Bergmann <sbergman@redhat.com>
Fri, 24 Sep 2021 14:54:48 +0000 (24 16:54 +0200)
committerStephan Bergmann <sbergman@redhat.com>
Fri, 24 Sep 2021 18:53:42 +0000 (24 20:53 +0200)
treec7f025ea56e72043d9ba0b67e6278c05a1270b45
parente3227975c0f42ff23d528f5ab94b4538c8af764c
GError::message is UTF-8

This caused CppunitTest_sw_dialogs_test to fail for LO_TEST_LOCALE=or hitting

> sal/rtl/ustring.cxx:530: void rtl_uString_newFromAscii(rtl_uString**, const char*): Assertion `static_cast<unsigned char>(*pCharStr) < 0x80' failed.

at

> #4  0x00007fd18a844f74 in rtl_uString_newFromAscii(rtl_uString**, char const*) (ppThis=0x7ffcb73e6e90, pCharStr=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at sal/rtl/ustring.cxx:530
> #5  0x00007fd1525af9c1 in rtl::OUString::createFromAscii(char const*) (value=0x6191180 "ସମୟ ସୀମା ପହଞ୍ଚିଯାଇଛି") at include/rtl/ustring.hxx:3328
> #6  0x00007fd1525ad026 in (anonymous namespace)::GErrorWrapper::~GErrorWrapper() (this=0x7ffcb73e6f38, __in_chrg=<optimized out>) at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:35
> #7  0x00007fd1525ad6a5 in (anonymous namespace)::request(char const*, com::sun::star::uno::Sequence<rtl::OUString> const&, std::u16string_view) (method=0x7fd1525b481d "InstallFontconfigResources", resources=uno::Sequence of length 1 = {...}, interaction=u"hide-finished") at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:91
> #8  0x00007fd1525ada9d in shell::sessioninstall::SyncDbusSessionHelper::InstallFontconfigResources(com::sun::star::uno::Sequence<rtl::OUString> const&, rtl::OUString const&) (this=0x5d22380, resources=uno::Sequence of length 1 = {...}, interaction="hide-finished") at shell/source/sessioninstall/SyncDbusSessionHelper.cxx:158
> #9  0x00007fd178670daa in psp::PrintFontManager::autoInstallFontLangSupport(Timer*) (this=0x2e3ed90) at vcl/unx/generic/fontmanager/fontconfig.cxx:962
> #10 0x00007fd178670cd9 in psp::PrintFontManager::LinkStubautoInstallFontLangSupport(void*, Timer*) (instance=0x2e3ed90, data=0x2e3efa0) at vcl/unx/generic/fontmanager/fontconfig.cxx:956
> #11 0x00007fd178341e03 in Link<Timer*, void>::Call(Timer*) const (this=0x2e3efc0, data=0x2e3efa0) at include/tools/link.hxx:111
[...]

(But probably better to use the lenient OUString-from-rtl_TextEncoding ctor
rather than OUString::fromUtf8, in case GError::message happens to not contain
proper UTF-8 after all, which would make the latter assert.)

Change-Id: I61fede4576988c5f7f35bb071ab3f2c0e7a15aa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122599
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
shell/source/sessioninstall/SyncDbusSessionHelper.cxx