mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 08:00:52 +02:00
* fix from Maxim Ganetsky to fix CRT output with non latin code pages, should fix #6785
git-svn-id: trunk@3606 -
This commit is contained in:
parent
2c622ca2f6
commit
adec4cdcfa
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user