Im trying to get my application to print the contents of a folder using cmd.exe. It works with one exception. Im icelandic and some of my folder names contain icelandic characters like '�' '�' '�' '�'...
The application initilizes the
String currentDir with this method:
currentDir holds the path which should be applied after the command "dir" in cmd.exe so when I type "ls" (which my shells command for "dir") it shows the content of the folder located in currentDir.
In my case the currentDir is:
C:\Documents and Settings\Torquemada\My Documents\Javaskr�r\Unnar\Verkefni 1 st�rikerfi which includes 2 icelandic characters '�' and '�' so when I execute "ls" nothing happents.
I made new string:
testString = "C:\\Documents and Settings\\Torquemada\\My Documents\\Javaskr�r\\Unnar\\Verkefni 1 st�rikerfi" and executed "ls" with testString as argument instead of currentDir and everything was fine. I even printed both the strings with System.out.println() and got this:
C:\Documents and Settings\Torquemada\My Documents\Javaskr�r\Unnar\Verkefni 1 sty
rikerfi
C:\Documents and Settings\Torquemada\My Documents\Javaskr�r\Unnar\Verkefni 1 st�
rikerfi
Equal? - false
The lower string is the one that works but the upper one that displays the string correctly doesn�t.
How do I fix it?
[ February 04, 2006: Message edited by: Unnar Bj�rnsson ]