BTM file encoding

In the olden days BTM files were encoded with IBM437. When I upgraded, the encoding apparently changed. My block characters no longer display properly. What in the new encoding?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
Have you checked that your current font actually includes the block graphics characters? Not all do.

Character encoding is between you, your text editor, and the CHCP command. If mojibake is an issue in your batch files, I suggest saving them as UTF-16.
 
May 20, 2008
11,414
99
Syracuse, NY, USA
Have you checked that your current font actually includes the block graphics characters? Not all do.

Character encoding is between you, your text editor, and the CHCP command. If mojibake is an issue in your batch files, I suggest saving them as UTF-16.
I took Roedy to mean when he RUNS the batch files.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
May 20, 2008
11,414
99
Syracuse, NY, USA
Or else add
Code:
CHCP 437
to your TCSTART.BTM file. That'd be another workaround.
I don't think that helps. Here, 437 is the console output CP, and I can't see 437's upper half correctly. Compare TYPE in v16 and v19.
Code:
v:\> ver & chcp 437 & type 437.txt

TCC  16.03.55  Windows 7 [Version 6.1.7601]
Active code page: 437
íóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ 
v:\> exit

v:\> ver & chcp 437 & type 437.txt

TCC  19.10.51  Windows 7 [Version 6.1.7601]
Active code page: 437
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
Vince, what is, if you make your test above with the TERMINAL font (in TCC, NOT in TCMD)? Would be interesting to know (if you have the time for) ...

Roedy and Vincent are both correct, and I was wrong. TCC is interpreting OEM text files according to the Windows code page, also miscalled the "ANSI code page", and not per the console code page as they ought.

I apologize for confusing the issue.
 
May 20, 2008
11,414
99
Syracuse, NY, USA
@vefatica

Vince, what is, if you make your test above with the TERMINAL font (in TCC, NOT in TCMD)? Would be interesting to know (if you have the time for) ...
It's the same with Terminal (as with Andale Mono, Lucida, and Consolas). All my tests have been with stand-alone TCC. WinDbg reveals that v19 calls MultiByteToWideChar with first argument 3 (CP_THREAD_ACP) while v16 calls the same function with first argument 437 (probably from GetConsoleOutputCP).
Code:
v:\> ver & echo %_fontinfo & chcp 437 & type 437.txt

TCC  16.03.55  Windows 7 [Version 6.1.7601]
2 8 12 400 Terminal
Active code page: 437
íóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■
v:\> exit

v:\> ver & echo %_fontinfo & chcp 437 & type 437.txt

TCC  19.10.51  Windows 7 [Version 6.1.7601]
2 8 12 400 Terminal
Active code page: 437
¡¢£☼¥▌§"cª«¬-r_°±²3'µ¶·,1º»¼½_¿AAAAÄÅÆÇEÉEEIIIIDÑOOOOÖxOUUUÜY_ßàáâaäåæçèéêëìíîïdñòóôoö÷oùúûüy_ÿ
v:\>
 
Jan 12, 2014
426
7
Switzerland, SO
Roedy and Vincent are both correct, and I was wrong. TCC is interpreting OEM text files according to the Windows code page, also miscalled the "ANSI code page", and not per the console code page as they ought.

I apologize for confusing the issue.
No need to apologize - codepages are evil - not just related to TCC/TCMD. I had and have frequently problems too - but not so frequently that I could not forget the important things about it :-)
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
P Kill all other instances of tcc from a btm batch file Support 2
D btm file command line augments comparing for string or math. Support 12
Roedy How to? Understanding BTM file properties Support 0
R Unable to start any BTM file from Explorer Support 5
vefatica BTM file hoses logon session Support 12
T Calling a BTM-file from explorer stops at promt after updating to 14 Support 7
A How to? Pass output from ffind to another command in a BTM file Support 5
F Click a .btm file with "TCC Startup Options" in effect. Support 8
M A probably stupid question about .btm file argument parsing... Support 6
p.f.moore Best way of embedding data in a BTM file Support 12
D Get command line in btm file with equal sign? Support 1
B bdebugger doesn't load btm-file in window Support 1
MickeyF equivalent to TCSTART.btm for TCMD? Support 4
vefatica Console not redrawn in BTM or with multiple commands Support 4
Charles S. Roaten Problems with TCSTART.BTM Support 1
C TCC 26 BATCOMP BTM problems? Support 5
B IF command problem in tcexit.btm Support 9
vefatica WAD DIR.BTM? Support 11
vefatica BTM, elevated, console window caption? Support 4
I BTM slower than BAT? Support 14
D check for network tcstart.btm and load if newer Support 3
Craig Fitzgerald Problems using tcstart.btm Support 3
vefatica Installer sets BTM associations wrongly Support 4
O I cannot use links to .btm files Support 5
CWBillow Can't right-click a BTM Support 7
C NE1 have BTM to remove %appdata\JP Software\ etc... Support 0
C interesting TCStarts.btm Support 2
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
Paul Berwanger BTM Bugs Support 2
M Drag and Drop for .BTM scripts Support 10
D WAD START /ELEVATED "Title" /PGM "job.btm" Support 6
C How to? run a BTM in elevated, inv tcc tab window Support 9
Fross GetOpt.btm Support 0
C How to? Add date/time to custom tpipe based BTM Support 1
thedave Problem chaining piped FIND commands in BTM Support 7
P Concatenating strings in a BTM Support 3
C Cmpr_Del.btm need help understanding UDF..... Support 2
G .BTM association doesn't work anymore Support 1
A 18.00.21 tries to cancel TCSTART.BTM Support 3
B How to? why does my BTM stop Support 2
redwdc btm won't run in ver. 17 but works in ver. 16 Support 11
I How to? Bat Works but BTM Doesn't Support 6
C Documentation .CMD .BAT .BTM Support 15
C TCMD17x64\tcchere.btm Support 3
T How to? sort history in tcexit.btm Support 22
Mezlo help with btm fragment Support 9
C REQ: tcmdhere.btm mod Support 11
vefatica Why isn't TCSTART.BTM run? Support 8
C move_all.btm Support 34

Similar threads