changeset 22732:2d74b4653e5d stable

Change codepage only for Windows 7 and newer (bug #49509). * QWinTerminal.cpp: Set console codepage to 65001 (UTF-8) only for Windows 7 and newer.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 04 Nov 2016 19:33:27 +0100
parents 838d52a3283e
children c426d8ec521d 4560273d100c
files libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Mon Nov 07 07:51:43 2016 -0800
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp	Fri Nov 04 19:33:27 2016 +0100
@@ -49,6 +49,7 @@
 #define _WIN32_WINNT 0x0500
 #endif
 #include <windows.h>
+#include <versionhelpers.h>
 #include <cstring>
 #include <csignal>
 #include <limits>
@@ -383,8 +384,11 @@
   l->addWidget (m_horizontalScrollBar, 1, 0);
   l->addWidget (m_verticalScrollBar, 0, 1);
 
-  SetConsoleCP (65001);
-  SetConsoleOutputCP (65001);
+  if (IsWindows7OrGreater ())
+    {
+      SetConsoleCP (65001);
+      SetConsoleOutputCP (65001);
+    }
 
   // Choose 15 (0xF) as index into the Windows console color map for the
   // background and 0 (0x0) as the index for the foreground.  This