Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6203271

File.exists() does not recognize directories/files in ISO-8859

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 2.0
    • core-libs
    • sparc
    • solaris

      JFileChooser does not select directories/files in European language. Please see the attached test java class.

      On Solaris machines, we could set this env first
      %setenv LANG iso_8859_1
      or %setenv LC_ALL iso-8859-1

      then run
      %java TestFilePath

      It shows
      ./ ../ Gef?hl Länder/

      Here is the question, is there any way I could set Locale in the application so JFileChooser could display European language directories and files?

      If no, how to set env Locale on windows and mac?

      We prefer to get it done in application instead of letting users set env.

      THanks,

      Jun


      ========================================================

      Here is a simple test case which shows the limitation when running in a C locale on Unix.

      import java.io.*;

      public class LS {
          public static void main(String[] args) throws Exception {
              File[] files = new File(".").listFiles();
              for (File f : files) {
                  System.out.print(f.getName());
                  if (!f.exists()) {
                      System.out.print("\t[File not found!]");
                  }
                  System.out.println();
              }
          }
      }

            iris Iris Clark
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: