diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-09-25 14:00:41 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-09-25 14:00:46 -0400 |
commit | cc7258bdfb44c5b5f3498296d8c9e6791655e89f (patch) | |
tree | 8952634c5d586c25c5d3bcb83524e69daded1cee /src/util.cpp | |
parent | 8efd87455bc957d6647c41680541d84e98e8353f (diff) | |
parent | 2c3eade704f63b360926de9e975ce80143781679 (diff) |
Merge #13877: utils: Make fs::path::string() always return utf-8 string on Windows
2c3eade704 Make fs::path::string() always return utf-8 string (Chun Kuan Lee)
Pull request description:
Imbue `fs::path` with `std::codecvt_utf8_utf16` at `SetupEnvironment()`, so that default string encoding will be utf-8 inside `fs::path`.
Tree-SHA512: 0cb59464d777278decbf24771fc5ff0cb2caa7bc2fe8ee5cd36c97a2324873a3caad131f08f050393b488316ee7f4ab0b28b7fa4699e41839f8e51b9867d5118
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index 75a387d7ec..fa624aee90 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1206,7 +1206,11 @@ void SetupEnvironment() // A dummy locale is used to extract the internal default locale, used by // fs::path, which is then used to explicitly imbue the path. std::locale loc = fs::path::imbue(std::locale::classic()); +#ifndef WIN32 fs::path::imbue(loc); +#else + fs::path::imbue(std::locale(loc, new std::codecvt_utf8_utf16<wchar_t>())); +#endif } bool SetupNetworking() |