aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-01-15 15:05:37 +0100
committerGitHub Enterprise <[email protected]>2026-01-15 15:05:37 +0100
commit3d45deaf460e8169814ea0244c75d21cbe48882f (patch)
tree3067e6137630cc315803d3d3978c56dded6226ac /src/zenserver/main.cpp
parentfix init of buildpart id in zen oplog-download (#711) (diff)
downloadzen-3d45deaf460e8169814ea0244c75d21cbe48882f.tar.xz
zen-3d45deaf460e8169814ea0244c75d21cbe48882f.zip
use current locale when converting wide char command line arguments to string (#712)
* set utf8 locale, only set LC_CTYPE as we don't want to affect how decimal point or sorting orders are handled * set language/region explicitly so we can use LC_ALL
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 34848c831..da256d06d 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -206,6 +206,10 @@ AppMain(int argc, char* argv[])
int
test_main(int argc, char** argv)
{
+# if ZEN_PLATFORM_WINDOWS
+ setlocale(LC_ALL, "en_us.UTF8");
+# endif // ZEN_PLATFORM_WINDOWS
+
zen::logging::InitializeLogging();
zen::logging::SetLogLevel(zen::logging::level::Debug);
@@ -218,6 +222,10 @@ test_main(int argc, char** argv)
int
main(int argc, char* argv[])
{
+#if ZEN_PLATFORM_WINDOWS
+ setlocale(LC_ALL, "en_us.UTF8");
+#endif // ZEN_PLATFORM_WINDOWS
+
using namespace zen;
if (argc >= 2)