question: public void testUtf8 ( ) throws Exception { String str = "AbCdEfGhIjKlMnOpQrStUvWxYzX" + "£ÅÉ" ; ByteArrayInputStream aa = new ByteArrayInputStream ( str . getBytes ( ) ) ; InputStreamReader a = new InputStreamReader ( aa ) ; try { assertEquals ( "UTF-8" , a . getEncoding ( ) ) ; int x = a . read ( ) ; assertEquals ( 'A' , x ) ; char [ ] c = new char [ 29 ] ; x = a . read ( c , 0 , 3 ) ; assertEquals ( 3 , x ) ; assertEquals ( "bCd" , new String ( c , 0 , 3 ) ) ; x = a . read ( c , 3 , 26 ) ; assertEquals ( 26 , x ) ; assertEquals ( "EfGhIjKlMnOpQrStUvWxYzX£ÅÉ" , new String ( c , 3 , 26 ) ) ; } finally { a . close ( ) ; } }
target:  Checks if Utf8 encoding works with InputStreamReader