[413] Accept-Charset:
ヘッダーは、
テキストの応答で利用者エージェントが受け入れられる charset
を指定するものです >>411。
[422] 歴史的には Web では様々な文字コードが使われており、
特定の言語のコミュニティーにおいて複数の文字コードが併存していたことがありましたから、
Accept-Charset:
によって利用者エージェントが対応している文字コードを明記し、
鯖は内容折衝によって指定された文字コードの資源を返すことが、
たまに行われていました。
[423] しかし現在では Web の文字コードは UTF-8 に収束しつつありますし、
そうでないとしてもすべての Webブラウザーが特定の文字コードの集合を実装し
(Encoding Standard を参照。)、鯖はそれらのうちのいずれかにより出力するようになっていますから、
内容折衝によって両者が摺り合わせを行う必要はなくなっています。
Webブラウザーも00年代までは Accept-Charset:
ヘッダーを要求に含めていましたが、現在では含めなくなっています。
[5] Accept-Charset:
ヘッダーは、
利用者エージェントが受け入れる意志がある文字符号化を表します。
[420] 要求に Accept-Charset:
がなければ、
任意の charset を受け入れることを表します >>411。
[4] 現在では、 Accept-Charset:
の値にかかわらず、
UTF-8 のみを受け入れるか、
あるいは Encoding Standard で規定された文字符号化すべてを受け入れるかのいずれかとみなすべきでしょう。
[414] 欄値は、1つ以上の値のリスト (#
) です >>411。
[416] それぞれの値は、 IANA charset 名か *
か、
それらのいずれかの後に q
引数を付加したものです >>411。
[418] *
は、 Accept-Charset:
に明示されていないすべての
charset を表します >>411。
[424] 文字コードが UTF-8 に収束しつつある現在、利用者エージェントは
Accept-Charset:
ヘッダーを生成するべきではありませんし、
起源鯖は Accept-Charset:
ヘッダーを無視して常に
UTF-8 を使うべきです。
[419] *
がなければ、明示されていないすべての charset
は受け入れられないものとみなします >>411。
[421] 起源鯖は、 Accept-Charset:
に利用可能な表現の
charset がなければ、 406
を返すこともできますし、
無視して内容折衝の対象でないものとして処理することもできます >>411。
[9] Accept:
に charset
引数が指定されていて、
Accept-Charset:
も指定されている場合、
どう処理するべきか HTTP では規定されていません。
[10] OData は Accept-Charset:
を優先させなければならないとしています
>>8。
[408] RFC 1945 (HTTP/1.0) D.2.2; RFC 2068・2616 (HTTP/1.1) 14.2 Accept-Charset
The Accept-Charset request-header field can be used to indicate
{1945} a list of preferred character sets other than the default US-ASCII and ISO-8859-1{2068,2616} what character sets are acceptable for the response. This field allows clients capable of understanding more comprehensive or special-purpose character sets to signal that capability to a server which is capable of representing documents in those character sets.{2068} The ISO-8859-1 character set can be assumed to be acceptable to all user agents.
Accept-Charset
要求頭欄は、
応答にどの文字集合が受入れ可能であるかを示すのに使うことが出来ます。
この欄によって、より包括的な、
あるいは特殊目的の文字集合を理解する能力があるクライアントが、
その能力をそれらの文字集合で文書を表現する能力があるサーバーに通知することができます。 ISO-8859-1
文字集合は全ての利用者エージェントに受入れ可能であると仮定できます。
Character set values are described in section 3.4. Each charset
{2068} may{2616} MAY be given an associated quality value which represents the user's preference for that charset. The default value is q=1. An example is
文字集合値は 3.4 節で説明しています。各 charset
は、その charset についての利用者の優先度を表す、関連付けられた品質値を与えても構いません。
既定値は q=1
です。例:
{2616} The special value "*", if present in the Accept-Charset field, matches every character set (including ISO-8859-1) which is not mentioned elsewhere in the Accept-Charset field. If no "*" is present in an Accept-Charset field, then all character sets not explicitly mentioned get a quality value of 0, except for ISO-8859-1, which gets a quality value of 1 if not explicitly mentioned.
特殊な値 *
が Accept-Charset
欄に出現した場合、 Accept-Charset
欄で他に触れられていない各文字集合
(ISO-8859-1
を含む。) に一致します。
*
が Accept-Charset
欄中に出現しない場合は、陽に触れられていないすべての文字集合が品質値
0
を得ます。但し ISO-8859-1
は、陽に示されていない限り品質値 1
を得ます。
If no Accept-Charset header is present, the default is that any character set is acceptable. If an Accept-Charset header is present, and if the server cannot send a response which is acceptable according to the Accept-Charset header, then the server SHOULD send an error response with the 406 (not acceptable) status code, though the sending of an unacceptable response is also allowed.
Accept-Charset
頭が示されている場合、
既定値は全ての文字集合が受入れ可能、です。
Accept-Charset
頭が示されている場合、
そしてサーバーが Accept-Charset
頭に従って受入れ可能な応答を送ることが出来ない場合は、
サーバーは 406
(受入れ不能) 状態符号の誤り応答を送るべきです。
但し受入れ不能な応答を送ることも認められています。
[407] Accept-Charset Is No More ( (Henri Sivonen 著, 版)) <http://hsivonen.iki.fi/accept-charset/>
[409] RFC 4463 - A Media Resource Control Protocol (MRCP) Developed by Cisco, Nuance, and Speechworks ( ( 版)) <http://tools.ietf.org/html/rfc4463#section-5.4.3>
[410] RFC 6787 - Media Resource Control Protocol Version 2 (MRCPv2) ( ( 版)) <http://tools.ietf.org/html/rfc6787#section-6.2.5>
[412] 現在ではどの Webブラウザーも Accept-Charset:
ヘッダーを送信しないようです。
[2] HTTP は伝統的に (仕様書上の) text/*
の charset
の既定値を ISO-8859-1
としてきたことから、 Accept-Charset:
においても
ISO-8859-1
が暗黙のうちに指定されてこととしていました。
しかしこれは RFC 7231 で削除されています >>3。
[425] HTML の accept-charset
属性は HTTP
の Accept-Charset:
ヘッダーに影響を受けていますが、
現在は異なる構文と処理モデルを有していて、定義上両者に関係はありません。
[426] Accept-Charset:
は文字コードに関するもので、
言語 (Accept-Language:
) や内容符号化
(Accept-Encoding:
) とは無関係です。
q
以外の引数は使えません。