+ Reply to Thread
Results 1 to 6 of 6

Thread: Help, Unicode support in Batch Files

  1. #1
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Question Help, Unicode support in Batch Files

    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!

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Help, Unicode support in Batch Files

    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.
    Nothing is always absolutely so.

  3. #3
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Re: Help, Unicode support in Batch Files

    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 by espfutbol98; 04-03-2011 at 02:26 PM.

  4. #4
    Sharky's Avatar
    Sharky is offline Admiral Awesome Sharky will become famous soon enough
    Join Date
    Oct 2007
    Location
    Outside the USA
    Posts
    3,306
    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

    ...
    The physics is theoretical but the fun is real.

  5. #5
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Re: Help, Unicode support in Batch Files

    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:


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

  6. #6
    boss.linkexchange46 is offline x10Hosting Member boss.linkexchange46 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    15

    Re: Help, Unicode support in Batch Files

    I need more knowledge about Batch Files , so please publish ........





    Thanks a lot

+ Reply to Thread

Similar Threads

  1. support for php files
    By munachindu55 in forum Free Hosting
    Replies: 1
    Last Post: 08-30-2010, 12:10 PM
  2. Unicode Not Transfered by the Server
    By gichan in forum Free Hosting
    Replies: 6
    Last Post: 04-10-2010, 01:05 PM
  3. PHP converting chinese character to unicode
    By diabolo in forum Programming Help
    Replies: 0
    Last Post: 01-01-2010, 04:02 PM
  4. Batch on a Mac
    By MarioMaster in forum Computers & Technology
    Replies: 1
    Last Post: 04-04-2008, 03:08 PM
  5. Apache Unicode Support
    By virtual in forum Free Hosting
    Replies: 5
    Last Post: 08-30-2007, 11:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers