For HTTP responses with Content-Types suggesting character data, which charset should be assumed by the client if none is specified?

后端 未结 6 1922
说谎
说谎 2021-02-07 23:08

If no charset parameter is specified in the Content-Type header, RFC2616 section 3.7.1 seems to imply ISO8859-1 should be assumed for media types of subtype "text":

6条回答
  •  醉话见心
    2021-02-07 23:26

    RFC 4329 defines the "application/javascript" media type as a replacement for "text/javascript", "application/x-javascript", and other similar types. Section 4.2 establishes the default character encoding to be UTF-8 when no explicit "charset" parameter is available and no Unicode BOM is present at the front of the data.

提交回复
热议问题