-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8u11
-
x86
-
os_x
FULL PRODUCT VERSION :
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
ADDITIONAL OS VERSION INFORMATION :
MacOS 13.4.0 Darwin Kernel Version 13.4.0
A DESCRIPTION OF THE PROBLEM :
Running the below code results in different behavior in JDK8 from JDK7
@Test
public void testTest() {
CharsetDecoder decoder = Charsets.UTF_8.newDecoder();
decoder.onMalformedInput(CodingErrorAction.REPLACE);
decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
ByteBuffer buf = ByteBuffer.allocate(20);
buf.put(new byte[] { (byte)0xf8, (byte)0xa1, (byte)0xa1, (byte)0xa1,
(byte)0xa1 });
buf.flip();
CharBuffer cbuf = CharBuffer.allocate(1);
CoderResult res = decoder.decode(buf, cbuf, false);
System.out.println(decoder.getClass().getName());
System.out.println("Pos --- "+buf.position()+ " cbuf pos --"+cbuf.position());
}
Jdk 7 output -->Pos --- 5 cbuf pos --1
Jdk 8 output -->Pos --- 1 cbuf pos --1
REGRESSION. Last worked in version 7u67
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
ADDITIONAL OS VERSION INFORMATION :
MacOS 13.4.0 Darwin Kernel Version 13.4.0
A DESCRIPTION OF THE PROBLEM :
Running the below code results in different behavior in JDK8 from JDK7
@Test
public void testTest() {
CharsetDecoder decoder = Charsets.UTF_8.newDecoder();
decoder.onMalformedInput(CodingErrorAction.REPLACE);
decoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
ByteBuffer buf = ByteBuffer.allocate(20);
buf.put(new byte[] { (byte)0xf8, (byte)0xa1, (byte)0xa1, (byte)0xa1,
(byte)0xa1 });
buf.flip();
CharBuffer cbuf = CharBuffer.allocate(1);
CoderResult res = decoder.decode(buf, cbuf, false);
System.out.println(decoder.getClass().getName());
System.out.println("Pos --- "+buf.position()+ " cbuf pos --"+cbuf.position());
}
Jdk 7 output -->Pos --- 5 cbuf pos --1
Jdk 8 output -->Pos --- 1 cbuf pos --1
REGRESSION. Last worked in version 7u67
REPRODUCIBILITY :
This bug can be reproduced always.
- relates to
-
JDK-7096080 UTF8 update and new CESU-8 charset
- Closed