[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#745605: apache2: ignores AddDefaultCharset



Control: tags -1 upstream
Control: retitle -1 apache2: AddDefaultCharset doesn't work for js

Looking at server/protocol.c, in ap_make_content_type():

        /* see if it makes sense to add the charset. At present,
         * we only add it if the Content-type is one of needcset[]
         */
        for (pcset = needcset_patterns; *pcset ; pcset++) {
            if (apr_strmatch(*pcset, type, type_len) != NULL) {

And above, we have:
static const char *needcset[] = {
    "text/plain",
    "text/html",
    NULL
};

So I guess AddDefaultCharset is only used for these two Content-Types. I
didn't test yet.

I think it's safe to add application/javascript to the list.

An alternative would be to improve the documentation upstream, and the
comments in charset.conf.


Carlos: Meanwhile, I suggest you specify the charset in your script tag,
as suggested in html specification [1].


[1] http://www.w3.org/TR/html5/scripting-1.html#the-script-element

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: