summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-28 19:47:24 -0400
committerBrad King <brad.king@kitware.com>2022-10-28 20:23:25 -0400
commite1c16791481f1741d65cb98878d8171307422513 (patch)
treef639e3ff8eae2428cff2cc493f9381ff875ebe93
parent328c15189d661503fbf6561731e550064e6a5567 (diff)
downloadcmake-e1c16791481f1741d65cb98878d8171307422513.tar.gz
cm_codecvt: Add support for the Windows console output code page
This is distinct from the Windows ANSI code page.
-rw-r--r--Source/cm_codecvt.cxx6
-rw-r--r--Source/cm_codecvt.hxx3
2 files changed, 8 insertions, 1 deletions
diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx
index 8115306d78..2d2a377eca 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 9af083fee1..f628de718c 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