cm_codecvt: Add support for the Windows console output code page

This is distinct from the Windows ANSI code page.
This commit is contained in:
Brad King
2022-10-28 19:47:24 -04:00
parent 328c15189d
commit e1c1679148
2 changed files with 8 additions and 1 deletions

View File

@@ -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;

View File

@@ -15,7 +15,8 @@ public:
None,
UTF8,
UTF8_WITH_BOM,
ANSI
ANSI,
ConsoleOutput,
};
#ifndef CMAKE_BOOTSTRAP