Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

File.exists() and accent on unix

807588Jan 28 2009 — edited Jan 29 2009
Hi,

I made a main which test if a file exists.
I created files "toto" and "tété" on windows.
On windows the two files are seen.
I transfered them on a redhat.
The file "toto" is seen but "tété" is not.

Here is the code :
public static void main(String[] args) {

        String filename = "/home/user/test/" + args[0]; 

        System.out.println(new File(filename).exists());
    }
I tried to put the name of the file but it was not seen.
public static void main(String[] args) {

        String filename = "/home/user/test/tété"; 

        System.out.println(new File(filename).exists());
    }
If someone could help me it would be great.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2009
Added on Jan 28 2009
6 comments
229 views