Echo unicode characters from UTF-8 Batch files?

Sep 29, 2014
21
0
I would like to use Unicode characters in a batch file with an ECHO command, but no matter how I choose the UnicodeOutput or UTF8 settings, I only can achieve this if the batch file is in UTF-16 (Little Endian) encoding (and perhaps not without the Byte Order Mark?), but I would like to my batch file to be in UTF-8 encoding.

While I was looking for an answer to this issue of my, I came across this post, which suggest using Iconv tool for converting the output file, and while I already have this tool on my machine, upon reading in the version history something about that TCC have "better" UTF-8 (might misunderstood something), I'm seeking a way to do this solely in TCC. Is it possible to control how a Batch file is interpreted? I would expect the Bite Order Mark would guide TCC which Unicode format to use.

I also just conducted some experiment with CHCP and the windows console, and I have absolutely no clue how things working. It is definitely doesn't work, if the terminal font's is a TrueType font, and it only works on future output, when it is a raster font. Knowing at some degree CHCP original purpose, I really shouldn't expect a coherent result though.
 
Similar threads
Thread starter Title Forum Replies Date
fpefpe How to? command echo in title line/bar Support 2
vefatica @EXECSTR clobbers @ECHO ON Support 2
L WAD ECHO. expansion of non-existent env-vars differs from CMD.exe Support 6
D Does TCC improve CMD's implementation of ECHO? Support 6
E My echo full file name to the clipboard fails now. Support 2
MickeyF how to ECHO in opposite colors? Support 12
Joe Caverly Echo message works without the space? Support 3
T Fixed Echo randomly activated in script Support 4
S How to? ^C echo Support 6
vefatica ECHO is very slow Support 9
J How to? Riddle: How to echo > into a file? Support 7
Alexander How to? how can I use Cyrillic characters in the Echo command? Support 8
vefatica WAD DO, ECHO, and trailing whitespace Support 3
nickles WAD echo "%PROGRAMFILES(X86)%" Support 16
J Can you redirect output to printer device with echo? Support 1
M How to? Save and then restore "Echo" status Support 2
T Set 1% then Echo 1% Support 9
M echo %@index[1234,.,-1] return -21 in new version Support 3
Roedy ECHO bug Support 4
T How do you echo lines with special characters to file? Support 4
Peter Murschall TEE cannot handle Unicode output Support 2
B Fullwidth Unicode forms display incorrectly Support 5
T @execstr unicode support Support 6
Peter Murschall TPIPE generate unicode on Piping or redirecting Support 3
D Pasting Unicode data has different behavior on TCC and CMD Support 2
vefatica TYPE goes crazy with no-BOM Unicode file Support 7
Charles Dye TCC smashing Unicode quotes Support 9
Peter Murschall UNICODE mixed with ANSI Code Support 11
Joe Caverly Unicode, Codepage 437, and line characters Support 3
B How to? Convert Unicode to ANSI Support 1
StarliteLemming Fileread fails on Unicode file Support 10
vefatica DO ... /P ... and Unicode? Support 3
vefatica Unicode ... I don't understand Support 1
Charles Dye @ASCII vs. @UNICODE Support 5
A How to? Filter history list with unicode chars Support 0
vefatica TYPE, Unicode, installer Support 10
A WAD Limitations on display of unicode punctuation marks Support 11
A Include lists and Unicode Support 1
M How to? How do I read a Unicode file through standard-input? Support 4
M WAD A bit of strangeness related to Unicode-marked file not being Unicode Support 2
M @CHAR and UNICODE Support 4
D LIST command wierdness with empty Unicode file Support 1
B Unicode/dword issue in TCC12 Support 4
J dir failure with some unicode characters Support 6
M TCC Unicode support? Support 7
vefatica BOMs in [dir]history / TAIL with Unicode Support 2
vefatica Unicode screw-up in IDE Support 4
vefatica Unicode anomaly Support 0
vefatica Debugger now Unicode? Support 1
vefatica TYPE /X and Unicode files? Support 0

Similar threads