summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-12-28 19:12:03 +0300
committerCaolán McNamara <caolanm@redhat.com>2021-01-01 21:08:00 +0100
commitdb860f33152e477e2e781869cd9cde18536a6483 (patch)
treeb692f456d761cc5165c2a06f0080d570020bfdb7 /unotools
parent76abecb3978603308db2edc6401a92a44f42f4e4 (diff)
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@collabora.com> (cherry picked from commit 02eaea1f93b516e35d4583158f87b2222fdd2640) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108576 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/resmgr.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index a1d74ec1b7cd..ef5b83cf06bc 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