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;