views:

4292

answers:

5

We have a project in TFS that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š letter to the command line tools. Command prompt or what not else messes it up, and the tf.exe utility can't find the specified project.

I've tried different formats for the .bat file (ANSI, UTF-8 with and without BOM) as well as scripting it in JavaScript (which is Unicode inherently) - but no luck. Anybody have an idea how to excecute a program and pass it a Unicode command line?

+10  A: 

Try:

chcp 65001

which will change the code page to UTF-8. Also, you need to use Lucida console fonts.

kgiannakakis
A: 

Not much of use to me. I am still not able to give inputs in RTL language.

I tried this command on command prompt also tried to change the code page of my application to UTF-8 65001 encoding.

A: 

Actually, the trick is that the command prompt actually understands these non-english characters, just can't display them correctly.

When I enter a path in the command prompt that contains some non-english chracters it is displayed as "?? ?????? ?????". When you submit your command (cd "??? ?????? ?????" in my case), everything is working as expected.

User
This is probably a bit dangerous as you could get naming conflict. e.g., if you have two files both which render as "???", and you enter "cd ???" it wouldn't know which to use (or worse would choose an arbitrary one).
John
You don't enter ???, you enter the real name it's just being displayed as ???. Think of it as of a password input box. Whatever you enter is displayed as ***, but submitted is the original text.
User
A: 

Similar problem, but within batch files.

I.e. the commands with the special characters run OK when copied/pasted into the command prompt, but fail inside a batch file. I've also tried changing the code page of the batch file itself without luck.

Using the chcp command causes the batch file to quit before it's finished.

Mike

Mike
A: 

I had same problem (I'm from czech republic). I have english instalation of windows and I have to work with file on shared drive. Path to this file include czech specific characters. Solution that works for me is:

In batch file, change charset page

My batch file:

chcp 1250 copy "O:\VEŘEJNÉ\ŽŽŽŽŽŽ\Ž.xls" c:\temp

Batch file has to be saved in CP 1250!!!

note that console will not show characters corretly but it will understand them ...

that's all ;)

vanna