Where as the same code compiled and run in JRE1.6 is not throwing the malinformed exception and the ascented characters are shown as boxes ,
why malformed input exception is not thrown in jre 1.6 ? we need the mal informed input exception for some cases
For starters, not that the encoding is called "UTF-8", not "utf-8", so that's what you should use. It's also specified that way in the javadocs.
I guess the salient question is: *Is* that character a valid UTF-8 encoded character? If so, then Java 6 is right not to throw an exception. What are the decimal values that character is represented by in the (supposedly) UTF-8-encoded representation?
Joined: May 21, 2012
changed utf-8 to UTF-8 .
the UTF8-encoded bytes as decimal numbers
195.155 - ó
but still jre1.6 is accetping the character .
where as jre1.4.2 malinformedinput exception is thrown why jre 6 is not throwing it ?
It might be that the Unicode representation has changed. Please review the documentation for the Character class and that Exception for Java1.4.2 and Java6. Please work out the representation of those two byte pairs into Unicode; it is not that difficult from the UTF-8 numbers, and compare their values in a 10‑year‑old version of Unicode and the more recent versions.
subject: Buffered reader readline not throws malformed input exception in jre1.6