You also need to specify "UTF-8" to getBytes() on line 574. See http://docs.oracle.com/javase/tutorial/i18n/text/string.html