DO ... /P ... and Unicode?

May 20, 2008
11,547
107
Syracuse, NY, USA
In the example below, the first command produces a correct filename. In the second and third, something gets lost in the translation.
Code:
c:\users\vefatica\desktop> dir /b /f *void*
C:\Users\vefatica\Desktop\www.voidtools.com • View forum - Everything.URL

c:\users\vefatica\desktop> do x in /p dir /b /f *void* ( echo %x )
C:\Users\vefatica\Desktop\www.voidtools.com ò View forum - Everything.URL

c:\users\vefatica\desktop> echo %@execstr[dir /b /f *void*]
C:\Users\vefatica\Desktop\www.voidtools.com ò View forum - Everything.URL
 
May 20, 2008
11,547
107
Syracuse, NY, USA
I'll bet they both work better after an OPTION //UNICODEOUTPUT=YES.
Yeah, but should that be necessary to get DO /P and @EXECSTR to work right? I'd expect any temp files created for those purposes to be Unicode by default. It's known in advance that their contents will be used as input. Now that you mention it, piping suffers in a similar (but slightly different) fashion. Below, in the second command, there should be a box-like (unprintable) character where the bullet belongs.
Code:
v:\> everything voidtools
C:\Users\vefatica\Desktop\www.voidtools.com • View forum - Everything.URL

v:\> everything voidtools | for /f "tokens=*" %x in (@con:) do echo %x
C:\Users\vefatica\Desktop\www.voidtools.com • View forum - Everything.URL

Since I can't know in advance, should I always use "OPTION //UNICODEOUTPUT=YES" before DO /P or @EXECSTR? If "yes", I'd rather TCC did it for me.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
It would be nice if TCC could look into the future and determine with 100% certainty what commands you're going to be running next. It might even be possible, provided I eliminate aliases, variables, and plugins.

You also want TCC to know in advance what external apps are going to be writing to a pipe -- that's a bit harder.

And you want it done before TCC even knows what the command is going to be, because redirection is done before the command (internal or external) is executed.

(I don't suppose you care that it would destroy any semblance of CMD compatibility when redirecting or piping.)
 
Similar threads
Thread starter Title Forum Replies Date
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 Unicode ... I don't understand Support 1
jadaml Echo unicode characters from UTF-8 Batch files? 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
dcantor Convert ASCII to Unicode or vice versa? Support 6
H HISTORY and DIRHISTORY /R can't handle Unicode Support 0
R Reading an Unicode file with more than 8191 lines Support 1

Similar threads