https://issues.apache.org/bugzilla/show_bug.cgi?id=50747
--- Comment #2 from Konstantin Kolinko <knst.koli...@gmail.com> 2011-02-09 15:39:00 EST --- > String data = "..."; > response.setCharacterEncoding("UTF-8"); > response.setContentLength(data.length()); > PrintWriter writer = response.getWriter(); The above code is wrong, because String.length() is measured in chars, but content-length header is measured in bytes. UTF-8 uses more than 1 byte for characters > 127. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- 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