diff options
| author | Dan Engelbrecht <[email protected]> | 2026-01-15 15:05:37 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-01-15 15:05:37 +0100 |
| commit | 3d45deaf460e8169814ea0244c75d21cbe48882f (patch) | |
| tree | 3067e6137630cc315803d3d3978c56dded6226ac /src/zencore/commandline.cpp | |
| parent | fix init of buildpart id in zen oplog-download (#711) (diff) | |
| download | zen-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/zencore/commandline.cpp')
| -rw-r--r-- | src/zencore/commandline.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zencore/commandline.cpp b/src/zencore/commandline.cpp index 78260aeef..426cf23d6 100644 --- a/src/zencore/commandline.cpp +++ b/src/zencore/commandline.cpp @@ -22,6 +22,10 @@ void IterateCommandlineArgs(std::function<void(const std::string_view& Arg)>& ProcessArg) { #if ZEN_PLATFORM_WINDOWS + // It might seem odd to do this here in addition to at start of main functions but the InitGMalloc() function is called before main (via + // static data) so we need to make sure we set the locale before parsing the command line + setlocale(LC_ALL, "en_us.UTF8"); + int ArgC = 0; const LPWSTR CmdLine = ::GetCommandLineW(); const LPWSTR* ArgV = ::CommandLineToArgvW(CmdLine, &ArgC); |