[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-4' - loolwsd/LOOLWSD.cpp
Tor Lillqvist
tml at collabora.com
Tue Oct 13 10:07:32 PDT 2015
loolwsd/LOOLWSD.cpp | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 6d940fe4ec77625ede2bd629e977ebb6da1989c6
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Oct 13 20:05:42 2015 +0300
bugs.ccu#1248: If locale is C, set it to en_US.utf8
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index d0acb7b..dc6cd67 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -41,6 +41,7 @@ DEALINGS IN THE SOFTWARE.
// number of child processes, each which handles a viewing (editing) session for one document.
#include <errno.h>
+#include <locale.h>
#include <pwd.h>
#include <unistd.h>
@@ -1015,6 +1016,12 @@ void LOOLWSD::startupDesktop(int nDesktops)
int LOOLWSD::main(const std::vector<std::string>& args)
{
+#ifdef __linux
+ char *locale = setlocale(LC_ALL, NULL);
+ if (locale == NULL || std::strcmp(locale, "C") == 0)
+ setlocale(LC_ALL, "en_US.utf8");
+#endif
+
if (access(cache.c_str(), R_OK | W_OK | X_OK) != 0)
{
std::cout << "Unable to access " << cache <<
More information about the Libreoffice-commits
mailing list