diff --git a/resources/meson.build b/resources/meson.build index 48dd45de3..bf8b39532 100644 --- a/resources/meson.build +++ b/resources/meson.build @@ -60,6 +60,7 @@ if host_platform == 'windows' ], depend_files: [ 'resource.h', + 'winutf8.xml', ], ) elif host_platform == 'darwin' diff --git a/resources/powder-res.rc b/resources/powder-res.rc index a591330f8..7bb0c594e 100644 --- a/resources/powder-res.rc +++ b/resources/powder-res.rc @@ -1,4 +1,6 @@ #include "resource.h" +#include IDI_ICON ICON DISCARDABLE "icon_exe.ico" IDI_DOC_ICON ICON DISCARDABLE "icon_cps.ico" +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "winutf8.xml" diff --git a/resources/winutf8.xml b/resources/winutf8.xml new file mode 100644 index 000000000..522749a1d --- /dev/null +++ b/resources/winutf8.xml @@ -0,0 +1,8 @@ + + + + + UTF-8 + + + diff --git a/src/common/platform/Windows.cpp b/src/common/platform/Windows.cpp index 585af3a1d..53ca59801 100644 --- a/src/common/platform/Windows.cpp +++ b/src/common/platform/Windows.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -398,6 +399,10 @@ void UpdateCleanup() void SetupCrt() { + _setmode(0, _O_BINARY); + _setmode(1, _O_BINARY); + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); if constexpr (DEBUG) { _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);