Browse Source

+ added checks for certain code pages that should not be allowed to be set in Video.ActivateCodePage

git-svn-id: branches/unicodekvm@48910 -
nickysn 4 years ago
parent
commit
14af3cb5cb
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/rtl-console/src/inc/video.inc

+ 8 - 0
packages/rtl-console/src/inc/video.inc

@@ -531,7 +531,15 @@ begin
 end;
 
 procedure ActivateCodePage(CodePage: TSystemCodePage);
+const
+  CP_UTF32LE=12000;
+  CP_UTF32BE=12001;
 begin
+  { disallowed codepages (variable length), code points larger than an 8-bit byte, etc. }
+  if (CodePage=CP_UTF8) or (CodePage=CP_UTF7) or
+     (CodePage=CP_UTF16) or (CodePage=CP_UTF16BE) or
+     (CodePage=CP_UTF32LE) or (CodePage=CP_UTF32BE) then
+    exit;
   if EnhancedVideoInitialized then
     CurrentLegacy2EnhancedTranslationCodePage := CodePage;
 end;