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

API/Doc: Locale variant is uppercased, no documentation

XMLWordPrintable

    • merlin
    • generic
    • generic



      Name: dbT83986 Date: 02/10/99


      I was under the impression that the Variant data member of the java.util.Locale SHOULD be used for specifying a
      code page. However, when you create a locale and specify the variant, the string is uppercased. This makes it
      incompatible with InputStreamReader. For example:

      Locale l = new Locale( "en", "GB", "Cp850" );

      String s = l.getVariant(); // s == "CP850"

      InputStreamReader r = new InputStreamReader( aStream, s );
      // throws UnsupportedEncodingException

      Note, I had mistakenly entered this as a bug against System.getProperties("file.encoding") which does, in fact,
      return a valid string. Apologies.

      Please direct us to how and whether the variant can be used.
      (Review ID: 49035)
      ======================================================================

            joconnersunw John Oconner (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: