[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - unotools/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 5 08:06:52 UTC 2021
unotools/source/i18n/resmgr.cxx | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 81d15be988f6d10251ad0e3ee84531fd20d3fe42
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Dec 28 19:12:03 2020 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jan 5 09:06:17 2021 +0100
tdf#119367: use Unicode paths on Windows in unotools
Change-Id: I671c42c5dfe5acc8a6dd670694c07ff04f08c3e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108477
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 02eaea1f93b516e35d4583158f87b2222fdd2640)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108716
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index 197816b21fc3..72c436232bb7 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -134,7 +134,14 @@ namespace Translate
rtl::Bootstrap::expandMacros(uri);
OUString path;
osl::File::getSystemPathFromFileURL(uri, path);
- OString sPath(OUStringToOString(path, osl_getThreadTextEncoding()));
+#if defined _WIN32
+ // add_messages_path is documented to treat path string in the *created* locale's encoding
+ // on Windows; creating an UTF-8 encoding, we're lucky to have Unicode path support here.
+ constexpr rtl_TextEncoding eEncoding = RTL_TEXTENCODING_UTF8;
+#else
+ const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
+#endif
+ OString sPath(OUStringToOString(path, eEncoding));
#endif
gen.add_messages_path(sPath.getStr());
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
More information about the Libreoffice-commits
mailing list