JDK-4287465 : RFE: Character converter Service Provider Interface (SPI) and API
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.1.4,1.2.0,1.2.1,1.3.0,1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_95
  • CPU: generic,x86
  • Submitted: 1999-11-03
  • Updated: 2000-03-21
  • Resolved: 2000-03-21
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description

Name: ft83308			Date: 11/03/99
Updated: nl37777                Date: 01/13/00


Characters are represented in many different ways on different platforms and in different locales. The Java platform uses Unicode as its internal character encoding, but software written in Java still needs to be able to interpret or produce text in the encodings of other software systems that it interacts with.

Releases 1.1 through 1.3 provide very limited ways to interpret or produce text in outside encodings: a few methods in the String class allow conversion between strings (encoded in Unicode) and byte arrays (encoded in some other encoding), and the InputStreamReader and OutputStreamReader classes allow text I/O in different encodings. There is no way for applications to convert text directly that's stored in data structures other than String, and the list of usable encodings is limited to those provided by a given Java runtime - there is no way add support for additional encodings. Developers have also complained about the lack of a well-defined naming scheme for Java character converters, and lack of support for IANA and MIME names.

The proposed character converter framework provides the following features:

- A character converter API which lets applications request character converters and interact with them directly; as well as obtain name information both for programmatic use (e.g., preferreed MIME name), and for display to the user. 
- A character converter Service Provider Interfacs (SPI) which allows licensees and independent software vendors to create character converters and associated name table entries that plug into any Java runtime. 
- A well-defined naming scheme for Java character converters, based as much as possible on existing standards. 
- An API that lets application determine a preferred encoding for each locale, e.g., to encode outgoing email. 

Along with the introduction of API and SPI, we'll also restructure the set of character converters that is provided by the J2RE:

- Update converter generator to generate converters for the SPI. 
- Package converters that are required for J2RE into separate platform independent and platform specific bundles: 
- National and international standards (Unicode variants, ISO 8859 series, ISO 2022, JIS 0201/0208/0212, Shift-JIS, GB 2312, etc.) 
- Encodings commonly used on the Internet (EUC, Windows 1252, Macintosh Roman, etc.) 
- Windows 
- Solaris (unless covered by Standards or Internet bundle) 
- Remove platform specific converters that are not required for J2RE ("Cp", Macintosh). We expect platform vendors to provide these converters. 
- Update remaining converters to plug into SPI. 

======================================================================

Comments
EVALUATION Planned for Merlin. norbert.lindenberg@Eng 2000-01-26
26-01-2000