1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BTM file encoding

Discussion in 'Support' started by Roedy, Jun 22, 2016.

  1. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    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?
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    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.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    I took Roedy to mean when he RUNS the batch files.
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Ack; I'd forgotten that one. (Saving batch files as UTF-16 is still a workaround, though.)
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    That doesn't bring back compatibility with CMD (and a long history).
     
  7. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    I quite agree. A workaround, not a fix.
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Or else add
    Code:
    CHCP 437
    to your TCSTART.BTM file. That'd be another workaround.
     
  9. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    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
    ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
     
  10. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    @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) ...

    Regards
     
  11. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    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.
     
  12. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,955
    Likes Received:
    30
    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:\>
     
  13. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    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 :-)
     
  14. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    So, in summary, the encoding TCC echo is using now is windows-1252, was IBM437.
    1252 is 8-bit with most of the high characters used by accented letters. There is not much to use
    for decoration. There are some raised dots, << >>, It has 5 unassigned slots.
    http://mindprod.comjgloss/encoding/windows-1252.html
     

Share This Page