aspose file tools*
The moose likes Java in General and the fly likes How to open/execute files with unicoded fileName? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to open/execute files with unicoded fileName?" Watch "How to open/execute files with unicoded fileName?" New topic
Author

How to open/execute files with unicoded fileName?

Ravi Sathish
Ranch Hand

Joined: Feb 26, 2002
Posts: 131
Hi all,

I'm trying to open a file with unicode in fileName (Cyrillic or Chinese characters) from Java(JDK 1.4.2) on Windows XP

I have tried encoding the url to UTF-8 etc... but nothing seems to work



However I can open the file from command line with:


I can also open with iexplorer too

Any pointers?

TIA
Ravi
[ November 01, 2006: Message edited by: Ravi Sathish ]
Ravi Sathish
Ranch Hand

Joined: Feb 26, 2002
Posts: 131
Any tools available to debug Runtime.getRuntime().exec()?

Any Books with details on Runtime.getRuntime()?

Any resources on "cmd.exe /c" & java
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

The Java compiler wants Latin-1 input; i.e., your program isn't well-formed. The String with the non-Latin-1 character in it isn't going to be parsed right in the first place, so trying to convert in in the Java source is doomed to fail. Instead, use a Unicode escape character:

String url = "\ua7e6.txt";


[Jess in Action][AskingGoodQuestions]
Ravi Sathish
Ranch Hand

Joined: Feb 26, 2002
Posts: 131
Thanks Sheriff

I have tried with unicode escape characters also... no difference...

I guess Java Compiler expecting ISO-Latin1 characters is a major problem

I tried compiling


Do you guys think... that I need to do more along these lines?

Ravi
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
When Runtime.exec() won't
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to open/execute files with unicoded fileName?