ASCII case‐insensitive

ASCII case‐insensitive

[1] ASCII 大文字・小文字不区別 (case‐insensitive) とは、 ASCII に含まれるラテン文字について、それらに限り大文字小文字を区別しないことをいいます。

[9] 照合順序 i;ascii-casemap は、 ASCII大文字小文字に置き換えることにより比較整列を行う照合順序です。

[4] Unicode には ASCII 文字以外のラテン文字ラテン文字以外のアルファベットも含まれますが、 ASCII大文字・小文字不区別な比較では、ASCII の26組のみが同一視され、それ以外はすべて互いに異なる文字とみなされます。

[29] 歴史的にプログラミング言語プロトコルマーク付け言語などで ASCII文字識別子や構文要素として使われてきましたが、 便宜上、大文字小文字を区別しないことがよくあります。 これをそのままUnicode文字の範囲に拡大すると、大文字小文字の対応関係が相当複雑で多対多対応になったりロケール依存になったりしてしまい、 実装サイズは増大し処理速度も低下します。しかし用途的にほとんどの場合は ASCII文字大文字小文字の同一視さえできればよく、 非ASCII文字ASCII文字と同一視されることも排除できた方が処理には好都合です。 ASCII大文字・小文字不区別なら、対象が Unicode文字であっても、 ASCII文字のみの大文字小文字の同一視と同程度の複雑さ、実装サイズ、処理速度で済むのです。

仕様書

定義

[10]

Comparing two strings in an ASCII case-insensitive manner means comparing them exactly, code point for code point, except that the characters in the range U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and the corresponding characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z) are considered to also match.

Web Applications 1.0 >>2 より、CORS >>16HSTS >>21WebSocket >>25 もほぼ同じ

[20] XPath 3.0/XQuery 3.0 における without regard to case比較とは、 ASCII の範囲の大文字小文字に置き換えて比較することをいいます >>19

応用

[12] ASCII大文字・小文字不区別は、 HTMLCSSDOM などで大文字小文字を区別しないことの定義として広く用いられています。

[13] 例えば HTML要素の名前は ASCII大文字・小文字不区別です。

[14] i;ascii-casemapRFC 6454起源の定義で使われていました。

[15] ASCII大文字・小文字不区別とするべきところ、 IETF で定義されたために同じく IETFi;ascii-casemap を参照しているのでしょう。

[18] RFC 6265 では i;ascii-casemap によって一致することを大文字・小文字不区別で一致 (case-insensitively match) と呼んでいます >>17

[23] mDNSUnicode文字列に対してASCII大文字・小文字不区別を規定しています (ただしこの比較方法に呼称を与えていません)。

演算

[30] 次の写像は、ASCII大文字・小文字不区別と実質的に同義ですが、 比較演算ではなく正規化演算を行うものです。

関連

[3] ASCII大文字・小文字不区別より大雑把な比較方法として、互換性大文字・小文字不区別があります。

[22] DNS (伝統的ドメイン名) における扱いは、 ASCIIラベルを参照してください。 (byte case-insensitive に相当します。)

メモ

[5] Unicode には U+0130U+0131 の2つの文字が場合によっては ASCIIIi と同一視されますが、ASCII大文字・小文字不区別な比較では同一視されません

[6] HTML では、大文字小文字の区別の必要がないほとんどすべての場面で、 ASCII大文字・小文字不区別な比較が行われます。

[7] RFC 1958 - Architectural Principles of the Internet ( ( 版)) http://tools.ietf.org/html/rfc1958#section-4

4.3 Public (i.e. widely visible) names should be in case-independent ASCII. Specifically, this refers to DNS names, and to protocol elements that are transmitted in text format.

[40] RFC 2244 - ACAP -- Application Configuration Access Protocol, , https://tools.ietf.org/html/rfc2244#page-16

[24] Add a common conjugation of case-sensitive for use by CSS. Also indic… · whatwg/dom@c3d7ce0 ( 版) https://github.com/whatwg/dom/commit/c3d7ce0eb0af63c3e4fe665c399df6bd7e5162d9

[26] RFC 4791 - Calendaring Extensions to WebDAV (CalDAV) ( 版) https://tools.ietf.org/html/rfc4791#section-7.5

CalDAV servers are REQUIRED to support the "i;ascii-casemap" and

"i;octet" collations, as described in [RFC4790], and MAY support

other collations.

[27] RFC 4791 - Calendaring Extensions to WebDAV (CalDAV) ( 版) https://tools.ietf.org/html/rfc4791#section-7.5

In the absence of a collation explicitly specified by the client, or

if the client specifies the "default" collation identifier (as

defined in [RFC4790], Section 3.1), the server MUST default to using

"i;ascii-casemap" as the collation.

[28] RFC 5255 - Internet Message Access Protocol Internationalization ( 版) https://tools.ietf.org/html/rfc5255#section-4.5

Other legacy servers use the i;ascii-casemap

comparator (see [RFC4790]).

[31] Editorial: start using the Infra Standard (annevk著, ) https://github.com/whatwg/encoding/commit/a26f76889bf393999e9caad84a3647ab09c39e09

[32] Editorial: leave ASCII case-insensitive to Infra (annevk著, ) https://github.com/whatwg/html/commit/5f3f27bfdf0e0139f6cf5f22508f37710d917c00

[33] Editorial: make use of the Infra Standard (annevk著, ) https://github.com/whatwg/dom/commit/bb2890beed2be14d2f7633ec89e2bbb88ec7fdcd

[34] XPath and XQuery Functions and Operators 3.1 () https://www.w3.org/TR/2017/REC-xpath-functions-31-20170321/#html-ascii-case-insensitive-collation

[35] XSLT and XQuery Serialization 3.1 () https://www.w3.org/TR/2017/REC-xslt-xquery-serialization-31-20170321/#caseless-compare

[36] RFC 5260 - Sieve Email Filtering: Date and Index Extensions () https://tools.ietf.org/html/rfc5260

The type of match defaults to ":is" and the default comparator is

"i;ascii-casemap".

[37] RFC 5260 - Sieve Email Filtering: Date and Index Extensions () https://tools.ietf.org/html/rfc5260

[38] RFC 3028 - Sieve: A Mail Filtering Language (, ) https://tools.ietf.org/html/rfc3028#section-2.1

The language is represented in UTF-8, as specified in [UTF-8].

Tokens in the ASCII range are considered case-insensitive.

[39] RFC 3028 - Sieve: A Mail Filtering Language, , https://tools.ietf.org/html/rfc3028#section-2.7