Hi,
it looks like the mechanism of changing the encoding works as expected, but
the computation of the correct contentlength not.
I downloaded the same page with 'ns_return', one time UTF-8 and one time
ISO-8859-15. The download of the latter stops at the correct number of bytes
but the Content-Length-Header is larger (the "UTF-8" size), so wget barfs,
Opera reloads page etc.
(The "recoding" is then only a test of the encoding. And see, recoding the
UTF-8 page to ISO results in the same byte length where the wget download
stops aka. "breaks", the "ISO-content-length").
Maybe this came with adding the -binary switch?
tclresp.c:
if (binary) {
data = (char *) Tcl_GetByteArrayFromObj(dataObj, &len);
result = Ns_ConnReturnData(conn, status, data, len, type);
} else {
data = Tcl_GetStringFromObj(dataObj, &len);
result = Ns_ConnReturnCharData(conn, status, data, len, type);
}