From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) From: Kenji Arisawa In-Reply-To: Date: Mon, 19 Oct 2009 12:35:50 +0900 Content-Transfer-Encoding: 7bit Message-Id: References: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] utf-8 text files from httpd Topicbox-Message-UUID: 8a29fe06-ead5-11e9-9d60-3106f5b1d025 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: 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 >> > >