Welcome!

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

SignUp Now!

@CHAR and UNICODE

May
855
0
And I quote from the "help" system:

@CHAR[n] : Returns the character corresponding to a Unicode numeric value.

Well, that's what it says, but I can't get it to output a UNICODE character no matter what value I use as an argument, and I've tried everything I can possibly think of for well over an hour here. (I really need UNICODE characters for what I intend to do.)

And on a similar, rather strange, note, the examples shown in the documentation for the @UNICODE function are all plain old ASCII!
 
And I quote from the "help" system:

@CHAR[n] : Returns the character corresponding to a Unicode numeric value.

Well, that's what it says, but I can't get it to output a UNICODE character no matter what value I use as an argument, and I've tried everything I can possibly think of for well over an hour here. (I really need UNICODE characters for what I intend to do.)

Code:
echo %@char[8220]Don%@char[8217]t Panic!%@char[8221]
echo %@char[0x201c]Don%@char[0x2019]t Panic!%@char[0x201d]

If you don't see the Unicode curly quotes, then you are probably using a non-Unicode font. One non-obvious gotcha: In a Take Command window, both the tab window font and the underlying console window must be set to use Unicode fonts....
 
Oh yeah. If you're redirecting to a file, don't forget to OPTION //UNICODEOUTPUT=YES -- otherwise all your nice Unicode characters will be smashed right back to ASCII.
 
Oh yeah. If you're redirecting to a file, don't forget to OPTION //UNICODEOUTPUT=YES -- otherwise all your nice Unicode characters will be smashed right back to ASCII.
Thank you, Charles!!! I strongly suspected that something like that must be the case, but between my bad memory and bad eyes, I couldn't remember it/find it. (Although I would suggest that Rex mention something about it in the documentation for the @Char function...) But I'll note two things: 1. 99.99 percent of the time I don't want/need UNICODE, and 2. In the interim I wrote a C++ program (blah!) to do what I needed to do, but I will be glad to avoid that in the future!
 
(Although I would suggest that Rex mention something about it in the documentation for the @Char function...)

Maybe, though it really isn't anything to do with @CHAR in particular; you'll see this behavior any time you use redirection. Perhaps UnicodeOutput should be mentioned in all of the help pages on redirection and piping?
 

Similar threads

Back
Top