JDK-5068812 : (spec) PrintStream documentation regarding character encodings appears incorrect
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 5.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2004-06-27
  • Updated: 2020-10-13
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
tbdUnresolved
Related Reports
Relates :  
Description
The following statement in the class javadoc appears incorrect:

 * <p> All characters printed by a <code>PrintStream</code> are converted into 
 * bytes using the platform's default character encoding. 

Each PrintStream uses an internal charset for character-to-byte conversion.  If
the charset is not specified during construction, the default charset will be
used.

Comments
SUGGESTED FIX *************** *** 24,33 **** * <code>println</code> methods is invoked, or a newline character or byte * (<code>'\n'</code>) is written. * ! * <p> All characters printed by a <code>PrintStream</code> are converted int\o ! * bytes using the platform's default character encoding. The <code>{@link ! * PrintWriter}</code> class should be used in situations that require writin\g ! * characters rather than bytes. * * @version %I%, %E% * @author Frank Yellin --- 24,35 ---- * <code>println</code> methods is invoked, or a newline character or byte * (<code>'\n'</code>) is written. * ! * <p> If an alternate {@linkplain java.nio.charset.Charset character encodin\g} ! * is not provided during construction, then all characters printed by a ! * <code>PrintStream</code> will be converted into bytes using the platform's ! * default character encoding. The <code>{@link PrintWriter}</code> class ! * should be used in situations that require writing characters rather than ! * bytes. * * @version %I%, %E% * @author Frank Yellin
26-10-2005

EVALUATION Yes. -- iag@sfbay 2004-06-27
27-06-2004