Unicode, Codepage 437, and line characters

I am using;
Code:
TCC  20.11.40 x64   Windows 7 [Version 6.1.7601]
TCC Build 40   Windows 7 Build 7601  Service Pack 1

I remember reading, quite a while ago on this forum, about Unicode, Codepage 437, and line characters, however, I now cannot find it.

I am re-compiling some of my Turbo Pascal DOS code to FreePascal x86-64. The problem is with line drawing characters. For example;
Code:
GotoXY(XCor-1, yCor-1); Write(#218);             
FOR co := 1 to Wid DO Write(#196); Write(#191);  
FOR ro := yCor to yCor + Choices -1 DO           
  BEGIN                                         
    GotoXY(xCor-1, ro); Write(#179);             
    GotoXY(xCor+Wid, ro); Write(#179);           
  END;                                           
  GotoXY(XCor-1, yCor+Choices); Write(#192);     
  FOR co := 1 to Wid DO Write(#196); Write(#217);

...produces this with Codepage 437 under 4DOS 8.00;
capture1.JPG

..but produces this with Codepage 437 under Windows;
Capture.JPG


CHCP under both OSes returns;
Code:
Active code page: 437

The @FONT function returns;
Code:
Font[0] = Consolas
Font[1] = 6
Font[2] = 12
Font[3] = 700
Font[4] = 54
Font[5] = 6

I would appreciate either links to the previous answers on this question (I am sure it has been asked before), or any new constructive solutions.

Thanks!

Joe
 

rconn

Administrator
Staff member
May 14, 2008
12,369
150
This is one of the rare cases where a non-Unicode font works better.

The line drawing characters in Terminal are high-bit ASCII (128-255) characters. The line drawing characters in Unicode are mapped to different locations -- if you use something like DRAWBOX / DRAWxLINE in TCC, it will use the Unicode characters, not the ASCII characters.
 
Similar threads
Thread starter Title Forum Replies Date
Peter Murschall TEE cannot handle Unicode output Support 2
B Fullwidth Unicode forms display incorrectly Support 5
T @execstr unicode support Support 6
Peter Murschall TPIPE generate unicode on Piping or redirecting Support 3
D Pasting Unicode data has different behavior on TCC and CMD Support 2
vefatica TYPE goes crazy with no-BOM Unicode file Support 7
Charles Dye TCC smashing Unicode quotes Support 9
Peter Murschall UNICODE mixed with ANSI Code Support 11
B How to? Convert Unicode to ANSI Support 1
StarliteLemming Fileread fails on Unicode file Support 10
vefatica DO ... /P ... and Unicode? Support 3
vefatica Unicode ... I don't understand Support 1
jadaml Echo unicode characters from UTF-8 Batch files? Support 1
Charles Dye @ASCII vs. @UNICODE Support 5
A How to? Filter history list with unicode chars Support 0
vefatica TYPE, Unicode, installer Support 10
A WAD Limitations on display of unicode punctuation marks Support 11
A Include lists and Unicode Support 1
M How to? How do I read a Unicode file through standard-input? Support 4
M WAD A bit of strangeness related to Unicode-marked file not being Unicode Support 2
M @CHAR and UNICODE Support 4
D LIST command wierdness with empty Unicode file Support 1
B Unicode/dword issue in TCC12 Support 4
J dir failure with some unicode characters Support 6
M TCC Unicode support? Support 7
vefatica BOMs in [dir]history / TAIL with Unicode Support 2
vefatica Unicode screw-up in IDE Support 4
vefatica Unicode anomaly Support 0
vefatica Debugger now Unicode? Support 1
vefatica TYPE /X and Unicode files? Support 0
dcantor Convert ASCII to Unicode or vice versa? Support 6
H HISTORY and DIRHISTORY /R can't handle Unicode Support 0
R Reading an Unicode file with more than 8191 lines Support 1
gschizas Fixed Using codepage 65001 (UTF-8) breaks non-ASCII characters Support 8
gschizas View uses Windows-1252 codepage instead of System codepage Support 4
N TCC doesnt respect active codepage? Support 7

Similar threads