tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: My patches for Tomcat 3.2 wrt mutlibyte characters
Date Thu, 07 Dec 2000 20:07:33 GMT
Pilho Kim wrote:

> Hi, Costin
> If you want to get Content-Length,
> is String.length() valid or not ?
> Tomcat dvelopers, containg you, must know this.

HTTP/1.1 spec (i.e. RFC 2616), Section 14.13:

    "The Content-Length entity-header field indicates
    the size of the entity-body, in decimal number
    of OCTETs, sent to the recipient or, in the case
    of the HEAD method, the size of the entity-body
    that would have been sent had the request been
    a GET."

In other words, content length is measured in bytes, not characters.  Therefore,
String.length() does not give you the right answer.

> Kim.

Craig McClanahan

View raw message