From e1c16791481f1741d65cb98878d8171307422513 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 28 Oct 2022 19:47:24 -0400 Subject: cm_codecvt: Add support for the Windows console output code page This is distinct from the Windows ANSI code page. --- Source/cm_codecvt.cxx | 6 ++++++ Source/cm_codecvt.hxx | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx index 8115306..2d2a377 100644 --- a/Source/cm_codecvt.cxx +++ b/Source/cm_codecvt.cxx @@ -19,6 +19,12 @@ codecvt::codecvt(Encoding e) #endif { switch (e) { + case codecvt::ConsoleOutput: +#if defined(_WIN32) + m_noconv = false; + m_codepage = GetConsoleOutputCP(); + break; +#endif case codecvt::ANSI: #if defined(_WIN32) m_noconv = false; diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx index 9af083f..f628de7 100644 --- a/Source/cm_codecvt.hxx +++ b/Source/cm_codecvt.hxx @@ -15,7 +15,8 @@ public: None, UTF8, UTF8_WITH_BOM, - ANSI + ANSI, + ConsoleOutput, }; #ifndef CMAKE_BOOTSTRAP -- cgit v0.12