Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open/execute files with unicoded fileName?

 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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";
 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When Runtime.exec() won't
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic