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 Bug
    • Status: Closed
    • Priority: Minor 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.

        Issue Links

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development