Here are all files in one Zip file
Here is the original test program:
Note that the characters in the program are the box characters from here:
They are the box characters form the 'extended ASCII Codes' ranging from #179 to #218 when displayed in almost any windows editor, that will still be #179 to #218, but now they are mapped to different characters. I do not believe UTF-8 are compatible with codes in this range from the original extended ASCII codes. If you want the characters to display properly, use the FreePascal Textmode IDE (type fp from a command prompt. ) I can only display the fonts properly in an editor by either using the FPC textmode IDE editor, or Notepad ONLY with an ASCII font I have.
Lazarus uses windows fonts, so it displays #201 as É.
I have made a simpler set of test programs and compiled some test results and posted them to my website, that thoroughly illustrate this issue.
Is a test program with just a bunch of writeln's making box characters.
It is run 2 ways, first without UNIT CRT; with the results here:
In these tests, I opened the file (with Unit CRT commented out) and ran It from Lazarus, FPC textmode IDE, Turbo Pascal 7.0, and also showed how the file looks with Notepad++, and normal notepad with ASCII font, and normal notepad with Consolas font.
You can see from this test that the output is the same for Lazarus, FPC textmode IDE, and Turbo Pascal 7.0.
In these tests I ran with the CRT unit, Again I compiled and ran it from Lazarus, FPC textmode IDE and Turbo Pascal 7.0. From this we see that Lazarus and FPC textmode IDE display the Unicode versions of the characters instead of extended Ascii... but Turbo Pascal 7.0 displays the same Ascii Characters that it does without CRT.
This is the program again but using Unicode characters.
You can see in the following tests that now the characters display correctly in Lazarus, but not FPC IDE or Turbo Pascal 7.0, that is because they are way outside the range of FPC IDE and Turbo Pascal 7.0, so they all actually show up as 3 characters.
Is a compilation of all the tests above, it shows that NOTHING displays this correctly!! Even though in Lazarus they look right, they are still wrong when it runs, it's also wrong in FPC IDE, and Turbo Pascal IDE
In these tests I turned the CRT unit on, but the characters are still never right.
Strangely, the results are not exactly the same when characters are specified with #codes
So I did another series of tests to demonstrate this:
This test uses the Unicode #codes in the Writeln command.
Now, you can see, without the CRT unit the codes are displayed properly with FPC, of course they aren't the Turbo Pascal 7.0 because they are not valid codes for TP7, but it's surprising they actually work in FPC when a writeln with the characters directly didn't work.
Even stranger that the fact that the codes work without CRT is what happens WITH CRT, someone must have re-mapped them to show kind-of a box using + for corners, etc... but why not map them to the correct box characters instead??
Just for completeness, I also used the Extended ASCII codes in a similar method to the previous test.
Results are expected without CRT on both FPC and turbo pascal 7.0, the box characters are correctly represented.
When CRT is used the results are the same incorrect symbols as when CRT is used with a direct Writeln;
I was wrong about PTCCRT, it does display Extended ASCII codes, but the reason it's useless is because it uses Borland BGI fonts, and they are not fixed width, so nothing lines up.
In my opinion, the CRT unit should be displaying the same original Extended ASCII characters that are displayed in the version without CRT... and the same as they are displayed on Turbo Pascal 7.0... but even if it was decided that the CRT unit use Unicode, then it should do that Correctly, which it does not. Whether CRT is using Extended ASCII or Unicode, as far as I can figure out, it's impossible to display box characters with the CRT unit at all.