From f939db95927c5e5f21dbcb7f89bc70678bc08558 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 4 Dec 2022 19:54:10 -0800 Subject: [PATCH] Ensure usernames with non-latin characters correctly reopens stderr against a local file. --- src/musikcube/Main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/musikcube/Main.cpp b/src/musikcube/Main.cpp index 721933e09..848c1fa8f 100644 --- a/src/musikcube/Main.cpp +++ b/src/musikcube/Main.cpp @@ -104,7 +104,11 @@ int main(int argc, char* argv[]) { #endif std::string errorFn = core::GetDataDirectory() + "stderr.txt"; +#ifdef WIN32 + _wfreopen(u8to16(errorFn).c_str(), L"w", stderr); +#else freopen(errorFn.c_str(), "w", stderr); +#endif auto prefs = Preferences::ForComponent(core::prefs::components::Settings);