JDK 18 |
---|
18 b25Fixed |
CSR :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
JDK-8277357 :
|
This issue was raised during the conversations in the following PR: https://github.com/openjdk/jdk/pull/5771 The constructors that take `OutputStream` w/o explicit charset defaults to use the `Charset.defaultCharset()` encoding. This is causing an issue if the OutputStream to wrap is a PrintStream, which holds its own charset, and it will be ignored. If those charsets differ, apps would end up specifying explicit charset on creating the PrintWriter, as in the said PR. This is especially problematic when PrintWriter wraps System.out/err, because with the JEP400, the default charset is now UTF-8 while standard I/O remains in `native.encoding`.
|