Saving a BAT file as Unicode with Windows XP?

Kelemvor

Lifer
May 23, 2002
16,928
8
81
Howdy,

I'm trying to make a simple menu in a Batch file through Notepad and am having a problem. I want to use Unicode characters so I can make a border around the menu. I can set it up and such but when I save it through Notepad, it tells me that I have to save it as Unicode for it to retain the ascii characters (alt + code). So I do that and it saves fine.

However, when I then try to run the BAT file, I get an error that

'¦' is not recognized as an internal or external command

It's like it's putting some character at the beginning of the file that Windows can't interpret.

Anyone know how I can make this work? I can save it as ANSI and the menu works fine but I don't get the borders that I want because ANSI removes the special characters.

Thanks.

Also, I tried saving it as Unicode, Unicode big endian, and UTF-8.
Unicode and big endian give the error above and the file doesn't even run.
UTF-8 lets the file run but the ascii characters don't show up. Instead I get:
GòÜGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGòÉGò¥
instead of
+---------------------+

 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Originally posted by: Kelemvor
Howdy,

I'm trying to make a simple menu in a Batch file through Notepad and am having a problem. I want to use Unicode characters so I can make a border around the menu. I can set it up and such but when I save it through Notepad, it tells me that I have to save it as Unicode for it to retain the ascii characters (alt + code). So I do that and it saves fine.

However, when I then try to run the BAT file, I get an error that

'¦' is not recognized as an internal or external command

It's like it's putting some character at the beginning of the file that Windows can't interpret.

Anyone know how I can make this work? I can save it as ANSI and the menu works fine but I don't get the borders that I want because ANSI removes the special characters.

Thanks.

The extra characters are the standard unicode text header on the top of the file. AFAIK the cmd interpreter doesnt handle them properly, so you couldnt use notepad to edit the file....

 

Kelemvor

Lifer
May 23, 2002
16,928
8
81
So what do I use to make the file then? Is there a different editor to use or some way to eave it as plain text but type in the ascii characters via their codes inline?
 

VirtualLarry

No Lifer
Aug 25, 2001
56,570
10,202
126
Have you tried using MS-DOS EDIT.COM? Then use ALT and then a three-digit code on the numeric keypad to enter the upper-ASCII characters "raw". That might work.