Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@execstr unicode support

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]
 
That worked. Thanks. It just seemed strange that, without the option change, it output unicode for one function, but not the other.
 
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.
 
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]
ЯНа
 
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....
 
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
ЯНа
ഄ਀
਀
 

Similar threads

Back
Top