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

java.util.Properties does not reads local symbols

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4
    • core-libs
    • None
    • x86
    • windows_95



      Name: paC48320 Date: 10/08/97


      1. Creates a properties file. For example, GrammarReader.properties
      Contents follows:
      BadDoubleNumberFormatMessage=ä
      End of contents.
      This properties contains one Russian letter with byte value equals to 228.

      2. Crates a demo class to read this file
      Source code follows:
      // Copyright 1997 Ruxy Consulting :-|
      import java.io.*;
      import java.util.*;

      public class test {
      public static void main(String[] args){

      ResourceBundle properties = ResourceBundle.getBundle("GrammarReader");
      String s = properties.getString("BadDoubleNumberFormatMessage");

      byte[] tmp = s.getBytes();


      System.out.println(tmp[0]);
      System.out.println( s );
      }
      }
      End of source.
      Compile and run this program. GrammarReader.properties must be in
      same dir as test.class

      3. Output:
      63
      ?
      End of output.
      But output must be
      228
      ä

      5.Problem appears in java.util.Properties class
      that actually reads the properties file.
      Part of source follows:
       public synchronized void load(InputStream in) throws IOException {
      in = Runtime.getRuntime().getLocalizedInputStream(in);
      End of source.
      But getLocalizedInputStream IS DEPRECATED
      according to JDK1.1.4 online docs.
      After that in code i found:
      key.append((char)ch);
      but I think it must be
              key.append((byte)ch)
      ======================================================================

            Unassigned Unassigned
            pallenba Peter Allenbach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: