TCC Unicode support?

May 30, 2008
67
1
Does TCC (commandline) support unicode .btm files?

If so, does it require the BOM, or can it determine encoding on it's own?
Are there any other encodings it supports (utf8 etc)?

I'm not sure if CMD.EXE (in windows 7) supports it though as I don't dare to try as executing random symbols (which it would be without unicode support) doesn't sound too good.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
> Does TCC (commandline) support unicode .btm files?

Yes.


> If so, does it require the BOM, or can it determine encoding on it's own?
> Are there any other encodings it supports (utf8 etc)?

The BOM mark is helpful (and faster), but provided it's more than a few
bytes long TCC can determine its type.

TCC does not support UTF-8 batch files (and I cannot think of a reason why
you would want to use them!)

Rex Conn
JP Software
 
May 20, 2008
11,539
103
Syracuse, NY, USA
On Sat, 24 Apr 2010 06:54:28 -0400, myarmor <> wrote:

|Does TCC (commandline) support unicode .btm files?
|
|If so, does it require the BOM, or can it determine encoding on it's own?
|Are there any other encodings it supports (utf8 etc)?

It's OK with a BOM.

It apparently doesn't work without a BOM.

v:\> ver

TCC 11.00.48 Windows XP [Version 5.1.2600]

v:\> type /x ucode.bat
0000 0000 65 00 63 00 68 00 6f 00 20 00 66 00 6f 00 6f 00 e.c.h.o. .f.o.o.
0000 0010 0d 00 0a 00 ....

v:\> ucode.bat
TCC: V:\ucode.bat [1] Unknown command "e"

(XP's) CMD cannot deal with it, with or without a BOM:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

v:\> ucode.bat (with BOM)

v:\> ÿþe
'ÿþe' is not recognized as an internal or external command,
operable program or batch file.

v:\> ucode.bat (without BOM)

v:\> e
'e' is not recognized as an internal or external command,
operable program or batch file.
--
- Vince
 
May 30, 2008
67
1
Thanks for the info..
With BOM it works as expected.

vefatica seems to be right though.. it apparently is somewhat bad at handling files without BOM (UTF-16 LE to be exact).
I tested with two ECHO lines, first with european, second with japanese in a unicodefile without BOM.

If the first char in the unicodefile is @ though, it doesn't complain nor run.

However, now when it's known, I know what to do :)

Finding a font which supports unicode in console, thats another matter (W7 Pro only lists Consolas, Lucida Console and Raster Fonts, and none of them seems to have much support for it).
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
> |Does TCC (commandline) support unicode .btm files?
> |
> |If so, does it require the BOM, or can it determine encoding on it's own?
> |Are there any other encodings it supports (utf8 etc)?
>
> It's OK with a BOM.
>
> It apparently doesn't work without a BOM.
>
> v:\> ver
>
> TCC 11.00.48 Windows XP [Version 5.1.2600]
>
> v:\> type /x ucode.bat
> 0000 0000 65 00 63 00 68 00 6f 00 20 00 66 00 6f 00 6f 00 e.c.h.o.
> .f.o.o.
> 0000 0010 0d 00 0a 00 ....

We've had this discussion before - Windows (not TCC) needs more than 10
bytes to determine whether a string is Unicode. If you want to write really
small Unicode batch files, you're going to have to insert the BOM.

Rex Conn
JP Software
 
May 30, 2008
67
1
I forgot to mention that this was ran on Windows 7 x64 Pro and newest version/update of Take Command (I tend to use only TCC of that package).

My test contained:
@echo off
echo This is a test of a .btm file without BOM
echo (15 japanese characters goes here, I don't include them in this post).

In other words, it was a bit more than 10 chars, and over 3 lines in total.
I'm not saying it is your fault or anything as you use the windows api's to determine it, I'm just mentioning it.

However, as long as it's knows it doesn't really bother me that much..
 
May 20, 2008
11,539
103
Syracuse, NY, USA
On Sun, 25 Apr 2010 12:42:24 -0400, myarmor <> wrote:

|My test contained:
|@echo off
|echo This is a test of a .btm file without BOM
|echo (15 japanese characters goes here, I don't include them in this post).
|
|In other words, it was a bit more than 10 chars, and over 3 lines in total.
|I'm not saying it is your fault or anything as you use the windows api's to determine it, I'm just mentioning it.

I'd recommend to Rex using IS_TEXT_UNICODE_STATISTICS in addition to the current
tests. It works better for me (recognizes short WCHAR strings, including L"echo
foo").
--
- Vince
 
Similar threads
Thread starter Title Forum Replies Date
D Pasting Unicode data has different behavior on TCC and CMD Support 2
Charles Dye TCC smashing Unicode quotes Support 9
A Can you set an image file 'tag' with TCC/4NT? Support 2
P PSHELL not working in TCC 26 Support 9
vefatica SCRIPT makes TCC disappear. Support 16
MickeyF TCC suddenly crashing (not TCC's fault) Support 2
Z CMDDebug - TCC unknown command Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 28.02.17 Support 0
vefatica TCC startup: /IP not honored after /K Support 1
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
C COMSPEC constantly reset to TCC.EXE Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Jay Sage Extra TCC Tasks Support 6
vefatica Can I turn off the minimize to tray mechanism in TCC? Support 5
N Command execution slows down in TCC Prompt after a while Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
samintz How to? Is this doable in TCC? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
D TCC tab detaching & restarting Support 3
Ó Recent git output not shown on TCC Support 1
P Kill all other instances of tcc from a btm batch file Support 2
L Using TCC.exe through an SSH connection Support 3
M TCC color issue in ConEmu Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
Alpengreis Python support for 3.8.3 in TCC v26.x? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.01.40 uploaded Support 0
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 26.0.37 Uploaded Support 0

Similar threads