Duplicate :
|
FULL PRODUCT VERSION : java version "1.7.0_04-ea" Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b227) Java HotSpot(TM) 64-Bit Server VM (build 23.0-b12, mixed mode) ADDITIONAL OS VERSION INFORMATION : Mac OS X 10.7.2 A DESCRIPTION OF THE PROBLEM : java.io.File class of Java7 can't handle a file with Japanese file name. REGRESSION. Last worked in version 7 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Execute the source code. The first argument is a directory name which contains Japanese file. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Shows list of "true:" and correct file names. ACTUAL - Shows list of "false:" and wrong file names. REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package test; import java.io.File; public class FileTest { public static void main(String[] args) { File[] files = new File(args[0]).listFiles(); for(File file : files) { System.out.println(file.exists() + ":" + file.getName()); } } } ---------- END SOURCE ----------