8599Views22Replies

Author Options:

How does one create a batch script that will run under unicode format? Answered

If you want to use special characters provided in command prompt and implement them in a batch script, how would one run a batch script in unicode format? Once it is created, a batch script must be run in ANSI encoding. But the special characters will be lost! Answers?

Discussions

0
user
Arbitror

Best Answer 8 years ago

Yes, you can echo "< " in batch. All you have to do is put a caret before the special symbol. But, I can't type a caret on Instructables, so I will use this: /\.

/\<

/\%

/\&

/\*

It's that simple!

You have the best answer so far, but what we need is to display special unicode format symbols that can be generated in a command prompt window, but strangely will not save as a unicode batch file and run.

Oooohhh, I see.

Good luck on that one! I don't even use batch anymore, I've moved on to more modern programming languages.


Thanks for best answer by the way!

Good luck with your own programming. Also, be on the lookout for TAT 2.4.2: TAT Reloaded coming in February...

Or sooner!

Even though I don't "batch" any more, I can't wait to see how far you guys have gotten on your project!

Is the output ultimately ANSI or can you get the .bat to produce a Unicode output?
What do you want to do anyway, there may be a better way of doing it?

L

We rquire to run an MS-DOS script in Unicode encoding. Nothing more, nothing less.

Sorry, MS-DOS is limited it what it accepts as input. There are ways around the issue, but plain and simple is ASCII-ANSI or nothing. Like lemonie asked, please explain what you're trying to do so that we may help you further.

At a guess you're not saying any more about this because you're worried that someone will steal your intellectual property? If ultimately you want to display non-ANSI characters in a DOS shell - you're out of luck. Have you considered programming the same application in something else?
And have you run this: "telnet towel.blinkenlights.nl"?

(Do something with creworksinc.com - it looks bad with all the default text in there)

L

Yes, we have seen the film, as incomplete and unstable and back door-opening as it is, when we were mere "script kiddies" about four years ago. We would be careful, anyone else may have been insulted with the comment you left. All we wish to do is display a special character in a batch script without switching to unicode or find a way to produce a batch script in unicode. We have tried cmd /u in a special comspec interface provided by the main system root, however to no expense.

Oh well good luck with whatever it is anyway. L

And you!

Did you solve this problem?

L

No, but we have managed to work around the issue. We really don't need an answer anymore, but we are willing to give you best answer if you can either provide us with an explanation as to why it is impossible, or better still, solve the problem.

Let's leave it open. Your work around is..?

L

Just using ANSI symbols, like = or *.

Insulted? Seriously? On the scale of "be nice" I would give it a neutral...



                                                                       V
                                ~Nice~             ~Neutral~         ~Darth Vader~

Damm - another disappearing comment. You said essentially what I did yesterday (which has vanished) - thanks. L

We type a special character ☼ in a batch file, but it turns out wrong when we keep the character ☼ and try to save in ANSI because ☼ is a unicode character and a batch file must be saved in ANSI or the batch file will not work.