[4] [DFN[IDNA2003]] は、[[IDN]] ([[国際化ドメイン名]]) の利用について定めた仕様 [[IDNA]] の2003年版です。

[12] [[IDNA2003]] ははじめて標準化された版であり、
はじめは単に「[[IDNA]]」と呼ばれていましたが、改訂版の [[IDNA2008]] の登場により区別のために
「2003」と付けられました。

;; [11] [CITE@en[RFC 5890 - Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework]]
<http://tools.ietf.org/html/rfc5890#section-1.1>

[5] [[IDNA2008]] により [[IDNA2003]] は置き換えられ廃止されていますが、非互換な変更を含むため、
実際にはまだ [[IDNA2003]] が使われています。

[17] [[IDNA2003]] では、既存の[[プロトコル]]や実働しているシステムへの変更無しで [[IDN]]
を扱うために、 [[IDN]] を [[ASCII文字]]に転写し、 [[IDN]] と [[ASCII]] 
の[[ドメイン名]]との変換を末端の[[アプリケーション]]内で行います。この [[ASCII文字]]への転写法としては
[[Punycode]] が採用されています。また、似た[[文字]]の[[正規化]]の方法として
[[Nameprep]] が規定されています。 [[IDNA]] を実装するには、 [[Punycode]] と [[Nameprep]]
を実装しなければ[['''なりません''']] [SRC[[[RFC 3490]] 1.3]]。

*仕様書

[REFS[
- [1] [CITE@en[RFC 3490 - Internationalizing Domain Names in Applications (IDNA)]] 
<http://tools.ietf.org/html/rfc3490>
- [16] [CITE[RFC Errata Report » RFC Editor]], [TIME[2021-04-23T09:58:19.000Z]] <https://www.rfc-editor.org/errata_search.php?rfc=3490>
- [2] [CITE@en[RFC 3491 - Nameprep: A Stringprep Profile for Internationalized Domain Names (IDN)]] 
<http://tools.ietf.org/html/rfc3491>
- [3] [CITE@en[RFC 3492 - Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)]] 
<http://tools.ietf.org/html/rfc3492>
]REFS]

* IDNA2003 を構成するもの

- [6] [[ToUnicode]] [[演算]]
- [8] [[ToASCII]] [[演算]]
- [7] [[Nameprep]] ([[Stringprep]] の[[プロファイル]])
- [9] [[Punycode]] ([[Bootstring]] の[[プロファイル]])
- [13] これらを用いた処理モデル ([[ドメイン名スロット]]での [[IDN]] に関する諸々の処理についての規定など)

* 演算

** ドメイン名に対する演算

[27] [[ドメイン名]]は次のように処理します。

= [21] まず、 [[ASCII]] や [[Unicode]] で[[符号化]]されていない文字列なら、
[[Unicode]] に変換します。
= [22] [[Stringprep]] でいうところの[[蓄積文字列]]と[[照合文字列]]のいずれかを決定します。
-- [[照合文字列]]であるなら、 [[AllowUnassigned]] [[フラグ]]を設定します。
= [23] [[ラベル分離子]]によって[[ドメイン名]]をそれぞれの[[ラベル]]に分割します。
= [24] 各[[ラベル]]に対して、 [[STD 3]] における[[ホスト名]]の [[ASCII文字]]に関する制限を適用するかどうかを決めます。
-- これは [[IDNA]] 以前から必要な作業であり、 [[IDNA]] 仕様はどちらにするか特に推奨するものではない、とされています。
-- この制限を適用するなら、 [[UseSTD3ASCIIRules]] [[フラグ]]を設定します。
= [25] [[ToASCII]] と [[ToUnicode]] のどちらか、適切な方を適用します。
= [26] [[ToASCII]] を適用したなら、[[ラベル分離子]]をすべて [CODE(char)[[[U+002E]]]]
[CODE(charname)@en[[[FULL STOP]]]] に置き換えます。

;; [28] [[RFC 3490]] <http://tools.ietf.org/html/rfc3490#section-4>

** ラベルに対する演算

[18] [[IDNA2003]] では[[ラベル]]に対して次の2つの[[演算]]が定義されています。

- [19] [[ToASCII]]
- [20] [[ToUnicode]]

* IDNA2008 との関係

[10] [[IDNA2008]] により [[RFC 3490]] と [[RFC 3491]] は廃止され、全面的に改訂されています。
[[RFC 3492]] は改訂されずにそのまま [[IDNA2008]] でも利用されています。

[29] [CITE@en[RFC 6797 - HTTP Strict Transport Security (HSTS)]]
( ([TIME[2014-06-02 05:16:10 +09:00]] 版))
<http://tools.ietf.org/html/rfc6797#section-8>

[30] [CITE@en[RFC 6797 - HTTP Strict Transport Security (HSTS)]]
( ([TIME[2014-06-02 05:16:10 +09:00]] 版))
<http://tools.ietf.org/html/rfc6797#section-8>

[FIG(quote)[
[FIGCAPTION[
[14] [CITE@en[RFC 5731 - Extensible Provisioning Protocol (EPP) Domain Name Mapping]]
([TIME[2015-03-22 17:40:40 +09:00]] 版)
<https://tools.ietf.org/html/rfc5731#section-2.1>
]FIGCAPTION]

> The syntax for domain and host names described in this document MUST
>    conform to '''['''RFC0952''']''' and '''['''RFC1123''']'''.  At the time of this writing, RFC
>    3490 '''['''RFC3490''']''' describes a standard to use certain ASCII name labels
>    to represent non-ASCII name labels.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[15] [CITE@en[RFC 7622 - Extensible Messaging and Presence Protocol (XMPP): Address Format]]
([TIME[2015-12-08 07:08:54 +09:00]] 版)
<https://tools.ietf.org/html/rfc7622#section-5>
]FIGCAPTION]

> 
>       Interoperability Note: For backward compatibility, many existing
>       XMPP implementations and deployments support IDNA2003 '''['''RFC3490''']'''
>       for domainparts, and the stringprep '''['''RFC3454''']''' profiles Nodeprep
>       and Resourceprep '''['''RFC3920''']''' for localparts and resourceparts.

]FIG]
