# HG changeset patch # User Alain Mazy # Date 1756387181 -7200 # Node ID 0fb25114517251e7a2ebdb263ddf9f5098ea1db6 # Parent 2f96938428c72f1ae620762d0ee9d0d601223115 Under Windows: configure the console to UTF-8 diff -r 2f96938428c7 -r 0fb251145172 NEWS --- a/NEWS Thu Aug 28 11:07:25 2025 +0200 +++ b/NEWS Thu Aug 28 15:19:41 2025 +0200 @@ -1,6 +1,12 @@ Pending changes in the mainline =============================== +Maintenance +----------- + +* Under Windows, the console output is now configured to interpret strings as UTF-8. + This notably allow cyrillic strings to display correctly in the console. + Version 1.12.9 (2025-08-11) =========================== diff -r 2f96938428c7 -r 0fb251145172 OrthancServer/Sources/main.cpp --- a/OrthancServer/Sources/main.cpp Thu Aug 28 11:07:25 2025 +0200 +++ b/OrthancServer/Sources/main.cpp Thu Aug 28 15:19:41 2025 +0200 @@ -52,6 +52,9 @@ #include +#if defined(_WIN32) || defined(__CYGWIN__) +#include +#endif using namespace Orthanc; @@ -1866,6 +1869,11 @@ int main(int argc, char* argv[]) { +#if defined(_WIN32) || defined(__CYGWIN__) + // Set Windows console output to UTF-8 (otherwise, strings are considered to be in UTF-16. For example, Cyrillic UTF-8 strings appear as garbage without that config) + SetConsoleOutputCP(CP_UTF8); +#endif + Logging::Initialize(); Logging::SetCurrentThreadName("MAIN"); SetGlobalVerbosity(Verbosity_Default);