Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to open/execute files with unicoded fileName?

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When Runtime.exec() won't
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic