Преглед на файлове

cm_codecvt: Add support for the Windows console output code page

This is distinct from the Windows ANSI code page.
Brad King преди 3 години
родител
ревизия
e1c1679148
променени са 2 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 6 0
      Source/cm_codecvt.cxx
  2. 2 1
      Source/cm_codecvt.hxx

+ 6 - 0
Source/cm_codecvt.cxx

@@ -19,6 +19,12 @@ codecvt::codecvt(Encoding e)
 #endif
 #endif
 {
 {
   switch (e) {
   switch (e) {
+    case codecvt::ConsoleOutput:
+#if defined(_WIN32)
+      m_noconv = false;
+      m_codepage = GetConsoleOutputCP();
+      break;
+#endif
     case codecvt::ANSI:
     case codecvt::ANSI:
 #if defined(_WIN32)
 #if defined(_WIN32)
       m_noconv = false;
       m_noconv = false;

+ 2 - 1
Source/cm_codecvt.hxx

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