[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-5' - loolwsd/LOOLWSD.cpp
Tor Lillqvist
tml at collabora.com
Tue Oct 13 10:07:49 PDT 2015
loolwsd/LOOLWSD.cpp | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 0ee52906d10001a0a11a8b053d9ba471bf466853
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 e12cbf4..8ef2c7e 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>
@@ -1048,6 +1049,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