[Libreoffice-commits] online.git: wsd/LOOLWSD.cpp

Michael Meeks michael.meeks at collabora.com
Thu Mar 15 21:05:05 UTC 2018


 wsd/LOOLWSD.cpp |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 18108dfa89d7064460f5c21e5dc79747f6cac239
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Mar 15 19:17:17 2018 +0000

    Help OSL's nlsupport with a UTF-8 locale for everyone.
    
    Change-Id: I98557e3134b436b6360129dfd6d16bba811cd864

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 47a63f428..5a11ea11d 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2726,11 +2726,9 @@ int LOOLWSD::innerMain()
 
     initializeSSL();
 
-    char* locale = setlocale(LC_ALL, nullptr);
-    if (locale == nullptr || std::strcmp(locale, "C") == 0)
-    {
-        setlocale(LC_ALL, "en_US.utf8");
-    }
+    // Force a uniform UTF-8 locale for ourselves & our children.
+    ::setenv("LC_ALL", "en_US.UTF-8", 1);
+    setlocale(LC_ALL, "en_US.UTF-8");
 
     if (access(Cache.c_str(), R_OK | W_OK | X_OK) != 0)
     {


More information about the Libreoffice-commits mailing list