@execstr unicode support

May 20, 2008
463
2
I am learning Russian and have a folder with the first name of my tutor. @execstr changes the Cyrillic characters to ???.

Code:
C:\Users\tim\Documents\Language\яна>
echo %@truename[new_vocab.txt]
C:\Users\tim\Documents\Language\яна\new_vocab.txt

C:\Users\tim\Documents\Language\яна>
echo %@execstr[cd]
C:\Users\tim\Documents\Language\???

C:\Users\tim\Documents\Language\яна>
ver

TCC  24.02.49 x64   Windows 10 [Version 10.0.17763.503]
 
May 20, 2008
463
2
That worked. Thanks. It just seemed strange that, without the option change, it output unicode for one function, but not the other.
 
May 20, 2008
10,498
77
Syracuse, NY, USA
That worked. Thanks. It just seemed strange that, without the option change, it output unicode for one function, but not the other.
Hmmm! The difference may be that @EXECSTR[] writes to a (temporary) file, and "OPTION UnicodeOutput" deals with redirected (e.g., to a file) output.

If that's what's happening, and we are to be oblivious to the use of temp files, it would make more sense if @EXECSTR[] always used Unicode temporary files.
 
May 20, 2008
10,498
77
Syracuse, NY, USA
I don't know how robust this is, but it works in this simple experiment.
Code:
v:\> function execstru `%@exec[@option //UnicodeOutput=Yes]%@execstr[%$]%@exec[@option //UnicodeOutput=No]`

v:\> set zz=%@char[1071]%@char[1053]%@char[1072]

v:\> echo %zz
ЯНа

v:\> echo %@execstr[echo %zz]
???

v:\> echo %@execstru[echo %zz]
ЯНа
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,188
72
Albuquerque, NM
prospero.unm.edu
Hmmm! The difference may be that @EXECSTR[] writes to a (temporary) file, and "OPTION UnicodeOutput" deals with redirected (e.g., to a file) output.
There may or may not be a temp file — I don't know. But UnicodeOutput also affects pipes.

Seen on Raymond Chen's blog today:
The saga begins in 1981. At this time, code pages roamed the earth....
 
May 20, 2008
10,498
77
Syracuse, NY, USA
There may or may not be a temp file — I don't know. But UnicodeOutput also affects pipes.
Yeah. I was playing with pipes. The only internal (VIEW, too) I can correctly pipe unicode output to is LIST. For example,
Code:
v:\> echo %zz
ЯНа

v:\> option //unicodeoutput=Yes & echo %zz | tail & option //unicodeoutput=No
ЯНа
ഄ਀
਀
I thought maybe this would change things, but it didn't.

Code:
v:\> alias utail `(option //unicodeoutput=Yes & tail & option //unicodeoutput=No)`

v:\> option //unicodeoutput=Yes & echo %zz | utail & option //unicodeoutput=No
ЯНа
ഄ਀
਀