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

java.util.Properties class doesn't work for localized properties.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • core-libs
    • None
    • sparc
    • solaris_2.5.1



      Name: mc57594 Date: 02/12/97


      Properties#save(OutputStream, String) can't be used for localized
      (i.e. Japanese) property values. There seems to be simple bug in
      Properties.java.

      --- Properties.java ----
      } else {
          prnt.write('\\');
          prnt.write('u');
          prnt.write((ch >> 12) & 0xF);
          prnt.write((ch >> 8) & 0xF);
          prnt.write((ch >> 4) & 0xF);
          prnt.write((ch >> 0) & 0xF);
      }
      ------------------------This should be:
      } else {
          prnt.write('\\');
          prnt.write('u');
          prnt.write(Character.forDigit((ch >> 12 & 0xF), 16));
          prnt.write(Character.forDigit((ch >> 8 & 0xF), 16));
          prnt.write(Character.forDigit((ch >> 4 & 0xF), 16));
          prnt.write(Character.forDigit((ch >> 0 & 0xF), 16));
      }

      Besides, Properties.java includes Runtime#getLocalized??Stream()
      and PrintStream class, which is deprecated as of JDK1.1.
      To save properties in escaped unicode character, it needs
      CharToByte8859_1 conversion, whatever default locale is.

      company - Nihon Sun Microsystems K.K. , email - ###@###.###
      ======================================================================

            bcbeck Brian Beck (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: