JDK-4210525 : API/Doc: Locale variant is uppercased, no documentation
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1999-02-10
  • Updated: 2000-03-24
  • Resolved: 2000-03-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 merlinFixed
Description
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)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin FIXED IN: merlin INTEGRATED IN: merlin
14-06-2004

WORK AROUND Name: dbT83986 Date: 02/10/99 None N/A ======================================================================
11-06-2004

EVALUATION In Java, there's no correlation between encodings and locales. However, the uppercasing of the locale variant is not mentioned in the javadoc. We either need to stop uppercasing, or document it. norbert.lindenberg@Eng 1999-02-23
23-02-1999