How to? Display text same as in CMD

May 22, 2013
21
0
#1
I have a problem displaying text correctly under Windows 10, using TCC 19 This affect my help screens in BTM files.
To illustrate the problem, I create a simple text file, code page is 437. See the difference between CMD.EXE and TCC.EXE in the attached picture.
How to get the same output as CMD.EXE
Image2.jpg
 
May 22, 2013
21
0
#3
This is probably a font (raster vs. Unicode) issue -- what font are you using in that session?

Please upload the tmp.txt file you created so we can test with that.
On the console I must use code page 437 and nothing else. Everything must work the same as TCC 11 (on an older system)
In CMD.EXE, use type tmp.txt and ik looks ok.
Unter TCC.EXE the same command does not dislay code page 437

I can not figure out how get everything work as before TCC 19
 

Attachments

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,724
47
Albuquerque, NM
prospero.unm.edu
#4
I see the same thing here. TCC 19.10.51, Windows 7 x86. Looks like TCC is interpreting an OEM text file according to the Windows code page, not the console code page.

Ruud, as a temporary workaround, could you create your text file as Unicode (UTF-16) instead of 8-bit characters?
 
May 22, 2013
21
0
#5
I see the same thing here. TCC 19.10.51, Windows 7 x86. Looks like TCC is interpreting an OEM text file according to the Windows code page, not the console code page.

Ruud, as a temporary workaround, could you create your text file as Unicode (UTF-16) instead of 8-bit characters?
No, I can't do that. The problem is in several BTM files between TEXT end ENDTEXT. It results in ugly and partial unreadable help screens.
 
#8
Just for info ...

I have the same "incorrect" result in Win AND TCC Console. Here this is logical because I set the Win Console to CP 1252 too (easier to handle all such things). Of course then such files has to be created and saved in CP 1252 - THEN all looks identical in Win and TCC Console AND even in native Win programs too.

PS: I have the Unicode Output NOT enabled for TCC.
 
May 22, 2013
21
0
#9
I did not create files. I have a lot of BTM files, created in the past. TCC and old 4NT have a nice structure TEXT ->> ENDTEXT used to display help. Rewriting all BTM-files is not an option.
I simply need a correct use of old OEM code pages.
 
May 22, 2013
21
0
#10
This is probably a font (raster vs. Unicode) issue -- what font are you using in that session?

Please upload the tmp.txt file you created so we can test with that.
Oeps.. I forgot the other thing you asked.
Font does not make any difference. I can use Lucida Console, Consolas or Raster fonts. Alle have the same effect. Under Windows 10 preview build 14352 (another machine) there are several extra fonts. Same effect.
 
Nov 2, 2008
194
1
#11
I did a little poking around in Windows 7 + tcc 19.0 + 4nt 8.0 32-bit etc. The examples by Ruud Uphoff are cp 850 for tcc and cp 437 for cmd. 850 might actually be ansii (1252), in either case, it's not 437.

437: dos editors (edit, qbasic, ibm e), cmd, command /c, v, view, lister (from www.ghisler.com - free), list (v Buerg)
850: tcc (type, list), metapad, notepad, command (type)

The active code page in the TCC, CMD and COMMAND are 850, but setting this to 437 seems to have no effect.

Lister gives ansi/oem/variable, giving 437 only for oem

It seems that the 'default' is not being taken as the OEM font but rather the System code page. You can see this in the view menu (view tmp.txt, then view|character encoding|....).
 
May 22, 2013
21
0
#12
Sorry, but regardless any other opinion, the files I've created the last twenty five years are all CP 437 and all worked fine in 4DOS, 4OS2, 4NT and last but not least TCC 11.
 
Last edited:
#13
And, as you probably know, Rex, ASCIIToUnicode() has changed its behavior. In v16, it correctly shows the test file in question (with box-drawing characters). In v19, it's as described above ... apparently (?) using the ANSI code page instead of GetConsoleOutputCP().
 
May 22, 2013
21
0
#14
Sorry; I thought you were reporting a problem specifically with TYPE. My misunderstanding. But the same idea applies -- can you save the BTM as UTF-16?
Aha...
I absolute deny to rewrite all my btm batch file, however, I found my editor could convert OEM to UTF-16 in just a few mouse clicks. YES thanks, this works.