https://issues.apache.org/bugzilla/show_bug.cgi?id=54602
--- Comment #3 from NateC <apa...@neworld.us> ---
InputStreamReader defaults to replacement characters so it won't reject those
characters just replace them with the replacement.

The underlying InputStreamReader holds on to those remaining bytes because it
is waiting for the last byte or end of stream but because B2CCoverter doesn't
try to read any more it never sees the the end of stream.

If B2CConver was changed to just read until ReadConvertor returned -1 then the
bytes wouldn't be left behind and the those last 4 bytes would be replaced with
the replacement character.

If you want invalid UTF-8 to be rejected you would have to update the
constructor of ReadConvertor to call super which takes a CharsetDecoder which
uses CodingErrorAction.REPORT, but that is a much bigger change.

I'll work on the test at some point, but I don't have the time currently to get
that working.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to