How to? Display text same as in CMD

May 22, 2013
34
0
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
34
0
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

  • tmp.txt
    583 bytes · Views: 139

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
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
34
0
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.
 
Jan 12, 2014
426
7
Switzerland, SO
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
34
0
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
34
0
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
231
2
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
34
0
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:
May 20, 2008
11,411
99
Syracuse, NY, USA
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
34
0
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.
 
Similar threads
Thread starter Title Forum Replies Date
G v28 Display Issue Support 7
samintz WAD Display wrapping issue Support 5
K Fixed Prompt display will be shifted after use dir to display a filename with Chinese. (v25.00.28 x64) Support 18
Jesse Heines How to? How to display picture creation date with dir command Support 6
B Fullwidth Unicode forms display incorrectly Support 5
D Need to set Take Command font size when switching to high DPI display Support 0
T FFind - can we display n number of lines after the find? Support 2
Joe Caverly PSHELL Blank Line Display Support 2
Alpengreis The TCMD Display problems and font size ... Support 2
vefatica Display of special characters in aliases. Support 25
T TCC display issue Support 1
MikeBaas How to? SELECT: exclude files / display prompt Support 2
D WAD TASKBAR options LogOff and ShutDown do not display a dialog Support 2
rfaquino How to? Display filename being copied on a single line Support 2
rps How to? Portable TCMD display problem Support 2
L Windows 8.1 version display Support 5
mfarah How to? Getting pdir to display relative paths. Support 2
D Folders pane display problem when starting Support 4
D Folders pane display problem after rename Support 0
C How to? Multi-Display Configuration Support 5
A WAD Limitations on display of unicode punctuation marks Support 11
N Incorrect display under TCMD 13 Support 1
Joe Caverly Display the VIEW window in a Take Command tab window Support 2
L FFIND no result display Support 10
B TCC v12 display double problem Support 2
B Bdebugger / IDE editor doesn't display called batch file Support 1
nikbackm UTF-8 display in TCMD Support 1
Peter Bratton IDE environment window display Support 0
G Display setting for Tabbed Toolbar Support 1
MickeyF Nice alias display Support 0
vefatica Tab (^t) in @FILEWRITE's text Support 2
R Bug TPIPE's pdf to text conversions don't work Support 2
Joe Caverly Using TYPE with non-English text Support 22
M Goto fails when a text endtext block precedes the code Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
S INPUT fails if the entered text contains pair of square brackets Support 6
Alpengreis List command: text truncated in find box (german) Support 9
vefatica Text invisible in v25 Support 10
S How to? What's the maximum size of the thread text ? Support 5
E Text copy bug Support 1
S FFIND text that includes " Support 7
S Setting Tabs=Bottom makes text turn black Support 6
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
D Grabbing html text with @line Support 3
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Find Files/Text dialog: does it work? Support 0
Alpengreis Installer: text is still truncated in german language Support 2
Peter Murschall IDE destroys Text on Ctrl-U/Ctrl-Shift-U Support 12
WinLanEm Read Cyrillic text from a file Support 12

Similar threads