we should note also http://www.w3.org/TR/html4/charset.html#h-5.2.2.
the document says:

To sum up, conforming user agents must observe the following priorities when determining
        a  document's character encoding (from highest priority to lowest):
        1. An HTTP "charset" parameter in a "Content-Type" field.
2. A META declaration with "http-equiv" set to "Content-Type" and a value set for "charset". 3. The charset attribute set on an element that designates an external resource.

Thus, hard coding "charset=utf-8" in http header will bring other problem
because that coding disables a line in html header such as:
        <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">

Kenji Arisawa

On 2009/10/19, at 11:16, Kenji Arisawa wrote:

according to rfc2616, default charset in sending text file is ascii:

  The "charset" parameter is used with some media types to define the
  character set (section 3.4) of the data. When no explicit charset
  parameter is provided by the sender, media subtypes of the "text"
type are defined to have a default charset value of "ISO-8859-1" when
  received via HTTP. Data in character sets other than "ISO-8859-1" or
  its subsets MUST be labeled with an appropriate charset value. See
  section 3.4.1 for compatibility problems.

httpd need explicitly charset=utf-8 in http header in sending utf-8 text.

Kenji Arisawa

On 2009/10/19, at 9:34, Akshat Kumar wrote:

I'm trying to put up a plain text file containing UTF-8
characters from httpd, but when viewing it from any
browser, it comes off as an ASCII file that needs to
be downloaded (so, those characters are garbled).
Is this due to some behaviour of httpd?

ak





Reply via email to