Help, Unicode support in Batch Files

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
Hello, I wrote a batch file to basically use a keyfile from an eToken in TrueCrypt but once I added Cyrilic characters and changed the encoding to Unicode, it keeps saying:"■ @" is not an internal or external command, operable program or batch file.
Code:
@echo off
color CF
ECHO =============================ОСОБАЯ ПАПКА============================
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO     Это устройство - закрытый систему на ^"ОСОБАЯ ПАПКА^" уровень.
ECHO.
ECHO Застрахите что систему соответствует минимальный сети, физической
ECHO безопасности, стирания диска методы, и другие требования для работы 
ECHO на этом уровне.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO =============================ОСОБАЯ ПАПКА============================
PAUSE
cd C:\Program Files\TrueCrypt
truecrypt /v \Device\Harddisk1\Partition3 /a /b /e /k token://slot/0/file/file.file /tokenlib C:\Windows\system32\eToken.dll /q
exit
I've opened the file with a hex editor and it says the first character is "FFFE" ("@") but under ACII filtering, shows an unknown character that is represented by "".

The thing that's wierd though is that my computer is in Russian with full support and I've made batch files like this before work properly. Thanks for the help!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Looks like a Byte Order Mark (BOM)

Try writing the file using Notepad++ and make sure the encoding is without BOM. I assume other programs have similar features.
 

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
Okay, I was using a program called notepad2 and I guess it didn't have that option. I made the file in Notepad++ encoded as "UTF-8 without BOM" but I think that's different from Unicode which wasn't an option. Now the file functions but outputs the text as ╨Ю╨б╨Ю╨С╨Р╨п ╨Я╨Р╨Я╨Ъ╨Р instead of ОСОБАЯ ПАПКА

Does anyone have any idea how to output the text properly?
 
Last edited:

Sharky

Community Paragon
Community Support
Messages
4,399
Reaction score
94
Points
48
As an aside, does it launch truecrypt, and does the batch window close afterwards?

If not, put the word start before truecrypt on the command

Eg start truecrypt blahblah

It won't wait for the program to exit that way.




And, if the first script works ok you could just replace the first line with

Echo off
Cls

...
 

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
As I mentioned before, the program functions (i.e. runs Truecrypt) just fine but the text is outputed incorrectly even after using UTF-8 without BOM. Here's a screenshot:
screenhot.png


-Note the Russian at the bottom of the prompt is from the OS, not the batch file itself.
 
Top