From 34bf19f395c48cacf1941fd71f5cfde200472fa1 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 27 May 2006 20:50:52 +0000 Subject: [PATCH] Merged revisions 3606 via svnmerge from http://svn.freepascal.org/svn/fpc/trunk r3606 (florian) * fix from Maxim Ganetsky to fix CRT output with non latin code pages, should fix #6785 git-svn-id: branches/fixes_2_0@3707 - --- rtl/win32/crt.pp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rtl/win32/crt.pp b/rtl/win32/crt.pp index 7386c7e448..11e74e311e 100644 --- a/rtl/win32/crt.pp +++ b/rtl/win32/crt.pp @@ -666,7 +666,11 @@ Function CrtWrite(var f : textrec) : integer; var i : longint; s : string; + OldConsoleOutputCP : Word; begin + OldConsoleOutputCP:=GetConsoleOutputCP; + SetConsoleOutputCP(GetACP); + GetScreenCursor(CurrX, CurrY); s:=''; for i:=0 to f.bufpos-1 do @@ -675,7 +679,7 @@ begin if s<>'' then begin WriteStr(s); - s:=''; + s:=''; end; WriteChar(f.buffer[i]); end @@ -684,6 +688,8 @@ begin if s<>'' then WriteStr(s); SetScreenCursor(CurrX, CurrY); + + SetConsoleOutputCP(OldConsoleOutputCP); f.bufpos:=0; CrtWrite:=0; @@ -704,7 +710,11 @@ Function CrtRead(Var F: TextRec): Integer; var ch : Char; + OldConsoleOutputCP : Word; Begin + OldConsoleOutputCP:=GetConsoleOutputCP; + SetConsoleOutputCP(GetACP); + GetScreenCursor(CurrX,CurrY); f.bufpos:=0; f.bufend:=0; @@ -781,6 +791,9 @@ Begin end; end; until false; + + SetConsoleOutputCP(OldConsoleOutputCP); + f.bufpos:=0; SetScreenCursor(CurrX, CurrY); CrtRead:=0;