tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50747] CometProcessor does not flush and close HTTP/1.0 requests
Date Wed, 09 Feb 2011 20:39:04 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50747

--- Comment #2 from Konstantin Kolinko <knst.kolinko@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message