Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-535

[classlib][luni] java.io.File doesn't properly work with the file names which have non-latin chars

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      J9, Windows

      Description

      java.io.File doesn't properly work with the file names which has non-latin chars on Windows (I tried Russian) .

      Minimal test case:

      import java.io.File;
      import junit.framework.TestCase;

      public class FileEncodingTest extends TestCase {
      private File russianNamedDir;

      protected void tearDown() throws Exception

      { russianNamedDir.delete(); }

      public void testCreateNonLatinDirectory() throws Exception

      { russianNamedDir = new File("c:\\temp\\\u0440\u0443\u0441_dir"); //coded 'rus' in Russian transliteration. russianNamedDir.mkdirs(); assertTrue(russianNamedDir.isDirectory()); }

      }

      The very important thing here is that Control Panel > Regional And Language Options > Regional Options tab > "Standards and formats" setting is set to "English US". All other regional settings (location, language for non-unicode programs) are set to Russian. If I switch "Standards and formats" to Russian everything works fine.
      Same problem with other extended unicode chars.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                richard_liang Richard Liang
                Reporter:
                aavtamon Anton Avtamonov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: