rem: len = -1;
context: NsGetTypeEncoding(NsServer *servPtr, char **typePtr, Ns_DString *dsPtr){    char *start, *end, *type, *charset;    int len;    charset = NULL;    type = *typePtr;    /*     * First, look for a charset within the type string.     */    start = Ns_StrCaseFind(type, "charset");    if (start != NULL) {	start += 7;	start += strspn(start, " ");	if (*start++ == '=') {	    start += strspn(start, " ");	    end = start;	    while (*end && !isspace(UCHAR(*end))) {		++end;	    }	    len = end - start;	    charset = start;	    len = end - start;	}    } else if (servPtr != NULL && dsPtr != NULL		&& (strncasecmp(type, "text/", 5) == 0)) {	/*	 * Use default server-specific default text/ charset,	 * if any, and update type string if configured.	 */	charset = servPtr->encoding.outputCharset;	if (charset != NULL && servPtr->encoding.hackContentTypeP) {	    len = -1;	    Ns_DStringVarAppend(dsPtr, type, "; charset=", charset, NULL);    	    *typePtr = dsPtr->string;	}    }    return (charset ? GetCharsetEncoding(charset, len) : NULL);}