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

(cs) Default file encoding not specified

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.0
    • core-libs
    • unknown
    • solaris_2.6

      String.getBytes() relies on the default encoding, but
      this encoding is not specified. Of course, the encoding
      depends on the platform and can't be the same worldwide.
      However, we don't specify how the default file encoding
      is set, when it is set, or how a developer can determine
      its value.

      Does the default file encoding depend on the file.encoding
      System.property? What methods use the default file encoding?
      The API specs don't say.

      The file.encoding System property is not specified, or even
      mentioned in the API specs. (See System.getProperties)

      The default file encoding touches a number of areas:

      * the -encoding flag of the javac compiler
      * String.getBytes(String enc)
      * String(byte[] byteArray, String enc)
      * InputStreamReader.getEncoding()
      * InputStreamReader( InputStream in, String enc)
      * UnsupportedEndodingException

      File encodings vary considerably around the world,
      so this is significant in terms of internationalization.

            sherman Xueming Shen
            dgreensunw Dale Green (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: