When porting from Turbo Pascal the FPC (Windows 10) CRT unit does not show the correct Dos OEM (cp437) extended char set
Original Reporter info from Mantis: stevewright
-
Reporter name: SteveWright
Original Reporter info from Mantis: stevewright
- Reporter name: SteveWright
Description:
This bug was reported and fixed in.......https://bugs.freepascal.org/view.php?id=32558 however the fix is not properly documented anywhere that I (or mr Google) can find.
With luck logging this bug will enable Google to find the fix and save anyone else with this problem a lot of time.
Steps to reproduce:
run the following code ................
program GraphicsTest;
Uses CRT;
var inchar:char;
i:integer;
s:string;
Begin
Clrscr;
s:=' ';
writeln('------------------------------------------------------------ ');
For I := 0 to 50 do s:=s+(chr(i))+' ';
writeln(s);s:=' ';
writeln('------------------------------------------------------------ ');
For I := 51 to 100 do s:=s+(chr(i))+' ';
writeln(s);s:=' ';
writeln('------------------------------------------------------------ ');
For I := 101 to 150 do s:=s+(chr(i))+' ';
writeln(s);s:=' ';
writeln('------------------------------------------------------------ ');
For I := 151 to 200 do s:=s+(chr(i))+' ';
writeln(s);s:=' ';
writeln('------------------------------------------------------------ ');
For I := 200 to 255 do s:=s+(chr(i))+' ';
writeln(s);s:=' ';
writeln('------------------------------------------------------------ ');
writeln(' ');
writeln(' ');
inchar:=readkey;
End.
Additional information:
The fix suggested in the above bug report is to add the following two lines at the top of the program (in FPC 3.2 or later?)
setsafecpswitching(false);
setuseacp(false);
However on its own this is not enough. What they did not tell you was that In 'Project options > Additions and Overrides, you must also add a custom override: -dDisableUTF8RTL
Mantis conversion info:
- Mantis ID: 36042
- OS: windows 10