8482Views22Replies

Author Options:

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

Picture of

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?

22 Replies

user
ArbitrorBest Answer (author)2009-12-06

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!

Select as Best AnswerUndo Best Answer

user
TATcreator (author)Arbitror2009-12-15

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.

Select as Best AnswerUndo Best Answer

user
Arbitror (author)TATcreator2009-12-15

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!

Select as Best AnswerUndo Best Answer

user
TATcreator (author)Arbitror2009-12-18

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

Or sooner!

Select as Best AnswerUndo Best Answer

user
Arbitror (author)TATcreator2009-12-18

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

Select as Best AnswerUndo Best Answer

user
lemonie (author)2009-04-25

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

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-04-25

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

Select as Best AnswerUndo Best Answer

user

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.

Select as Best AnswerUndo Best Answer

user

If there is no way, then that is appropriate. Thank you.

Select as Best AnswerUndo Best Answer

user
lemonie (author)TATcreator2009-04-26

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

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-04-27

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.

Select as Best AnswerUndo Best Answer

user
lemonie (author)TATcreator2009-04-27

Oh well good luck with whatever it is anyway. L

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-12-21

Thank you, and merry Christmas!

Select as Best AnswerUndo Best Answer

user
lemonie (author)TATcreator2009-12-22

And you!

Did you solve this problem?

L

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-12-22

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.

Select as Best AnswerUndo Best Answer

user
lemonie (author)TATcreator2009-12-23

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

L

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-12-23

Just using ANSI symbols, like = or *.

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-12-21

We appreciate all of your help.

Select as Best AnswerUndo Best Answer

user
Arbitror (author)TATcreator2009-12-18

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



                                                                       V
                                ~Nice~             ~Neutral~         ~Darth Vader~

Select as Best AnswerUndo Best Answer

user

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

Select as Best AnswerUndo Best Answer

user
TATcreator (author)lemonie2009-04-25

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.

Select as Best AnswerUndo Best Answer