https://issues.apache.org/bugzilla/show_bug.cgi?id=50747

--- Comment #2 from Konstantin Kolinko <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to