JDK-4304013 : RFE: Add UTF-7 to encoding converters
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,windows_nt
  • CPU: generic,x86
  • Submitted: 2000-01-11
  • Updated: 2008-11-20
  • Resolved: 2008-11-20
Related Reports
Duplicate :  
Description

Name: rf98795			Date: 01/11/2000



Add UTF-7 to the standard set of supported encoding converters.  This is useful 
when trying to pass Unicode data through transports that are only ASCII safe. 

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

Here is some additional evidence of why supporting this encoding within
the J2SE core set of converters might need to be considered:
Taken from RFE #4679523



Name: bs11			Date: 05/03/2002


FULL PRODUCT VERSION :
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Classic VM (build 1.3.0, J2RE 1.3.0 IBM build co130-20020124 (JIT enabled: jitc)
)


FULL OPERATING SYSTEM VERSION :
The Operating System/2 Version is 4.50

A DESCRIPTION OF THE PROBLEM :
JavaMail should support all mail-specific charsets, such as
"unicode-1-1-utf-7" and perhaps others.

Hotmail.com, among others, frequently uses this encoding and
when JavaMail encounters it it results in the specified
error message (see below).

I have attached a testcase mail for you to parse below.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. See testcase
2.
3.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.io.UnsupportedEncodingException: unicode-1-1-utf-7
	at sun.io.Converters.getConverterClass(Converters.java:97)
	at sun.io.Converters.newConverter(Converters.java:128)
	at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:71)
	at java.io.InputStreamReader.<init>(InputStreamReader.java:85)
	at com.sun.mail.handlers.text_plain.getContent(text_plain.java:65)
	at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:755)
	at javax.activation.DataHandler.getContent(DataHandler.java:511)
	at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:531)

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Return-Path: <>
Received: from hotmail.com (mc1-s11.law16.hotmail.com [65.54.236.60]) by
 HSE-QuebecCity-ppp3503426.sympatico.ca (Weasel v1.40) for
 <###@###.###>; 16 Apr 2002 22:17:09
Received: from hotmail.com ([65.54.236.21]) by hotmail.com with Microsoft
SMTPSVC(5.0.2195.4905);
	 Tue, 16 Apr 2002 19:16:08 -0700
  From: ###@###.###
  To: ###@###.###
Date: Tue, 16 Apr 2002 19:15:49 -0700
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
	boundary="9B095B5ADSN=_01C1E58710E1D33C0000BFAChotmail.com"
Message-ID: <###@###.###>
  Subject: Delivery Status Notification (Failure)
Return-Path: <>
X-OriginalArrivalTime: 17 Apr 2002 02:16:09.0046 (UTC) FILETIME=[D64F7F60:01C1E5B5]

This is a MIME-formatted message.
Portions of this message may be unreadable without a MIME-capable mail program.

--9B095B5ADSN=_01C1E58710E1D33C0000BFAChotmail.com
Content-Type: text/plain; charset=unicode-1-1-utf-7

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

       ###@###.###

--9B095B5ADSN=_01C1E58710E1D33C0000BFAChotmail.com--
---------- END SOURCE ----------
(Review ID: 145766) 
======================================================================


###@###.### 2002-05-03
JavaMail depends on the charset support in the JDK, so support for this
charset needs to be added to the JDK.

Comments
EVALUATION Once we have the character converter SPI (RFE 4287465), anybody could implement this converter, but it's probably worthwhile having it as part of the J2RE. norbert.lindenberg@Eng 2000-01-26 Name: db100478 Date: 09/08/2000 Committing to merlin release ====================================================================== UTF-7 charset support (as a bundled charset component of J2SE) will not happen for 1.5. Apart from lateness in time to implement compared to 1.5 release cutoffs this is a good example where frameworks, eg Ref implementations of JavaMail,etc should be able to use the public API/SPI to write and provide a UTF-7 implementation rather than have it bundled as a core J2SE supported encoding. ###@###.### 2003-11-07
07-11-2003