Network Working Group F. Yergeau Request for Comments: 2279 Alis Technologies Obsoletes: 2044 January 1998 Category: Standards Track UTF-8, ISO10646 変換フォーマット UTF-8, a transformation format of ISO 10646 このメモの状態 Status of this Memo この文書は、インターネットコミュニティのために、インターネットの標準通 信プロトコルを指定し、また、改善のための議論と提案を求めるものである。 このプロトコルの標準化の状態は最新版の"インターネット公式プロトコル標準" (STD 1) を参照されたし。このメモの配布は無制限である。 This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited. 著作権表示 Copyright Notice Copyright (C) The Internet Society (1998). All Rights Reserved. 要約 Abstract ISO/IEC10464-1 は、Universal Character Set (UCS) と呼ばれる世界の大部分 の言語をカバーするマルチバイト文字セットを定義している。しかしながら、マ ルチバイト文字は、現在の多くのアプリケーションやプロトコルと互換性がな い。これによって、お互いに異なる性質を持ったいくつかUCS変換フォーマット (UTF)が開発された。このメモの対象であるUTF-8は、US-ASCIIの全体を維持し、 US-ASCIIの値に依存するファイルシステム、パーサー、その他のソフトウェアに 互換性を保ちながら、他の値を透過させる性質を持っている。このメモは、特に、 関連する標準のバージョンの問題を扱い、RFC2044を改版し、置き換える。 ISO/IEC 10646-1 defines a multi-octet character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. Multi-octet characters, however, are not compatible with many current applications and protocols, and this has led to the development of a few so-called UCS transformation formats (UTF), each with different characteristics. UTF-8, the object of this memo, has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo updates and replaces RFC 2044, in particular addressing the question of versions of the relevant standards. 1.序 1. Introduction ISO/IEC10464-1 は、Universal Character Set (UCS) と呼ばれる世界の大部分 の言語をカバーするマルチバイト文字セットを定義している。定義されている2 つのマルチバイトエンコード方法(UCS-4と呼ばれている4バイトペア文字によ るエンコード方法、UCS-2と呼ばれる2バイトのペア文字によるエンコード方法) では、UCSの先頭の64K文字(基本的多言語平面,BMP)のみを扱える。現在はBMP以 外のプレーンには、文字は割り当てられていない。 ISO/IEC 10646-1 [ISO-10646] defines a multi-octet character set called the Universal Character Set (UCS), which encompasses most of the world's writing systems. Two multi-octet encodings are defined, a four-octet per character encoding called UCS-4 and a two-octet per character encoding called UCS-2, able to address only the first 64K characters of the UCS (the Basic Multilingual Plane, BMP), outside of which there are currently no assignments. 同一の文字セットがUnicode標準 [UNICODE] で定義されていることに注意すべ きである。Unicodeは、追加の文字属性と実装者にとって非常に興味深い詳細な 応用を定義しているが、UCS-4エンコードは持っていない。現在まで、Unicode 仕様の変更とISO/IEC 10646の改正は、お互いに追随している。この為、文字の 種類の多さと、コ-ドの(不足の)問題は、同様に残されていた。適切なる標 準化委員会は、この非常に有用な同期を維持することを約束している。 It is noteworthy that the same set of characters is defined by the Unicode standard [UNICODE], which further defines additional character properties and other application details of great interest to implementors, but does not have the UCS-4 encoding. Up to the present time, changes in Unicode and amendments to ISO/IEC 10646 have tracked each other, so that the character repertoires and code point assignments have remained in sync. The relevant standardization committees have committed to maintain this very useful synchronism. しかしながら、UCS-2やUCS-4エンコードは、8ビットましてや7ビットを想定し ている現在の多くのアプリケーションやプロトコルで使用するのは困難である。 16ビットで動作する新しいシステムでさえ、UCS-4は扱うことができない。こ の状況によって、お互いに異なる性質を持ったUCS変換フォーマット(UTF)と呼ば れるものが開発された。 The UCS-2 and UCS-4 encodings, however, are hard to use in many current applications and protocols that assume 8 or even 7 bit characters. Even newer systems able to deal with 16 bit characters cannot process UCS-4 data. This situation has led to the development of so-called UCS transformation formats (UTF), each with different characteristics. UTF-1は歴史的に興味深いだけであり、ISO/IEC10646から削除されている。UTF-7 は最上位ビットがクリアされたバイト(7ビットUS-ASCII [US-ASCII])だけを 使ってBMPの全ての範囲をエンコードする能力を持っている。この事は、メール に安全なエンコードであると考えられる([RFC2152])。この文書の対象である UTF-8は、8ビット全てを使用するが、US-ASCIIの全ての範囲を保存する性能を 持っている。US-ASCII文字は、通常のUS-ASCII値を持つ1バイトにエンコードさ れ、この値を持つバイトは、US-ASCII以外の何者も意味することはない。 UTF-1 has only historical interest, having been removed from ISO/IEC 10646. UTF-7 has the quality of encoding the full BMP repertoire using only octets with the high-order bit clear (7 bit US-ASCII values, [US-ASCII]), and is thus deemed a mail-safe encoding ([RFC2152]). UTF-8, the object of this memo, uses all bits of an octet, but has the quality of preserving the full US-ASCII range: US-ASCII characters are encoded in one octet having the normal US- ASCII value, and any octet with such a value can only stand for an US-ASCII character, and nothing else. UTF-16は、UCS-4のサブセットを予約された範囲からUCS-2のペアに変換する手順 である。UTF-16は、予約された範囲か変換されたUCS-2を特別に扱わなければな らないという影響をUTF-8に及ぼしている。 UTF-16 is a scheme for transforming a subset of the UCS-4 repertoire into pairs of UCS-2 values from a reserved range. UTF-16 impacts UTF-8 in that UCS-2 values from the reserved range must be treated specially in the UTF-8 transformation. UTF-8は、UCS-2ないしUCS-4の文字をさまざまなバイト長にエンコードする。こ のバイト長は、ISO/IEC10646で割り当てられた整数値に依存する。この変換フォ ーマットは、以下の性質を持っている(全ての値は16進である)。 UTF-8 encodes UCS-2 or UCS-4 characters as a varying number of octets, where the number of octets, and the value of each, depend on the integer value assigned to the character in ISO/IEC 10646. This transformation format has the following characteristics (all values are in hexadecimal): - 0000 0000から0000 007F(US-ASCIIの範囲)の文字値は、00から7F(7ビット US-ASCII値)に対応する。この結果、通常のASCII文字列は、正当なUTF-8文字列 であることになる。 - Character values from 0000 0000 to 0000 007F (US-ASCII repertoire) correspond to octets 00 to 7F (7 bit US-ASCII values). A direct consequence is that a plain ASCII string is also a valid UTF-8 string. - US-ASCII値は、これ以外ではUTF-8エンコードされた文字ストリームに出現 しない。この事は、ファイルシステムやUS-ASCII値による文法解析を行うが、そ れ以外の値は透過させる他のソフトウェア(例えば、C言語ライブラリの printf() 関数)での互換性が保たれる。 - US-ASCII values do not appear otherwise in a UTF-8 encoded character stream. This provides compatibility with file systems or other software (e.g. the printf() function in C libraries) that parse based on US-ASCII values but are transparent to other values. - UTF-8とUCS-4,UCS-2いずれとの相互変換も容易である。 - Round-trip conversion is easy between UTF-8 and either of UCS-4, UCS-2. - マルチバイト数列の最初のバイトは、その数列のバイト長を表示する。 - The first octet of a multi-octet sequence indicates the number of octets in the sequence. - FE と FF は決して出現しない。 - The octet values FE and FF never appear. - バイトストリームのどこからでも、文字の境界を容易に見つけることができ る。 - Character boundaries are easily found from anywhere in an octet stream. - UCS-4でのソート順が維持される。もちろん、このソート順は、文化的には 意味がないので、限られた意味があるだけであるが。 - The lexicographic sorting order of UCS-4 strings is preserved. Of course this is of limited interest since the sort order is not culturally valid in either case. - Boyer-Mooreの高速サーチアルゴリズムが、UTF-8でも使うことができる。 - The Boyer-Moore fast search algorithm can be used with UTF-8 data. - UTF-8文字列は、簡単なアルゴリズムでかなり正確に認識することができ る。すなわち、他の方法でエンコードされた文字列が正当なUTF-8であるように 見える可能性は低く、文字列が長くなれば、なお低くなる。 - UTF-8 strings can be fairly reliably recognized as such by a simple algorithm, i.e. the probability that a string of characters in any other encoding appears as valid UTF-8 is low, diminishing with increasing string length. UTF-8は元来、UNIXと互換性を持ち、多国語をひとつのエンコード方法でサポー トするファイルシステムに安全な変換フォーマット [FSS-UTF] を規定する目的 のX/Open Joint Internationalization Group XOJIG のプロジェクトであった。 もともとの作者はGary Miller, Greger Leijonhufvud, John Entenmannである。 後に、Ken Thompson と Rob Pikeも公式なUTF-8に対して、十分な貢献を行った。 UTF-8 was originally a project of the X/Open Joint Internationalization Group XOJIG with the objective to specify a File System Safe UCS Transformation Format [FSS-UTF] that is compatible with UNIX systems, supporting multilingual text in a single encoding. The original authors were Gary Miller, Greger Leijonhufvud and John Entenmann. Later, Ken Thompson and Rob Pike did significant work for the formal UTF-8. この説明は、Unicode技術報告#4とUnicode標準 version 2.0 [UNICODE] にも記 載されている。UTF-16の関する事項も含むUTF-8の最終的なリファレンスは、 ISO/IEC10646-1 [ISO-10646]の別紙Rである。 A description can also be found in Unicode Technical Report #4 and in the Unicode Standard, version 2.0 [UNICODE]. The definitive reference, including provisions for UTF-16 data within UTF-8, is Annex R of ISO/IEC 10646-1 [ISO-10646]. 2.UTF-8の定義 2. UTF-8 definition UTF-8では、文字は1から6バイトの数列にエンコードされる。1バイトの数列 では、そのバイトの最上位ビットは0にセットされ、残りの7ビットが文字値を エンコードするために使われる。nバイト(n>1)の数列では、先頭バイトの 上位nビットが1にセットされ、続いて1ビットの0がセットされる。残りのビ ットには文字の値をエンコードしてセットされる。以降のバイトは、最上位ビッ トは1にセットされ、次のビットが0にセットされる。残りの6ビットは、文字 をエンコードしてセットされる。 In UTF-8, characters are encoded using sequences of 1 to 6 octets. The only octet of a "sequence" of one has the higher-order bit set to 0, the remaining 7 bits being used to encode the character value. In a sequence of n octets, n>1, the initial octet has the n higher-order bits set to 1, followed by a bit set to 0. The remaining bit(s) of that octet contain bits from the value of the character to be encoded. The following octet(s) all have the higher-order bit set to 1 and the following bit set to 0, leaving 6 bits in each to contain bits from the character to be encoded. 下記の表は、これらの異なったバイトタイプのフォーマットの概略である。文字 x は、UCS-4の文字値のエンコードに使えるビットを表わしている。 The table below summarizes the format of these different octet types. The letter x indicates bits available for encoding bits of the UCS-4 character value. UCS-4 range (hex.) UTF-8 octet sequence (binary) 0000 0000-0000 007F 0xxxxxxx 0000 0080-0000 07FF 110xxxxx 10xxxxxx 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx 0001 0000-001F FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 0020 0000-03FF FFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 0400 0000-7FFF FFFF 1111110x 10xxxxxx ... 10xxxxxx UCS-4からUTF-8へりエンコード手順は下記の通り: Encoding from UCS-4 to UTF-8 proceeds as follows: 1)文字値と上記の表の最初の欄から、バイト長を決定する。表のこの欄は、相 互に排他的であることに注意することが重要である。すなわち、エンコードする ために与えられたUCS-4文字に対して、正当な方法はただ一つである。 1) Determine the number of octets required from the character value and the first column of the table above. It is important to note that the rows of the table are mutually exclusive, i.e. there is only one valid way to encode a given UCS-4 character. 2)表の第二の欄のように、各バイトの上位ビットを準備する。 2) Prepare the high-order bits of the octets as per the second column of the table. 3)文字値のビットから x にマークされたビットを埋める。文字値の下位ビッ トから始め、まず数列の最後のバイトに置く、次いで、最後から二番目…を、全 ての x ビットが埋まるまで続ける。 3) Fill in the bits marked x from the bits of the character value, starting from the lower-order bits of the character value and putting them first in the last octet of the sequence, then the next to last, etc. until all x bits are filled in. UCS-2(またはUnicode)をエンコードするアルゴリズムは、上記のアルゴリズを、 単純にUCS-2の文字を2つのゼロのバイトで拡張して適用することによって得る ことができる。しかしながら、UCS-2のD800からDFFFまでの値(Unicodeのサロゲ ートペア)は、実際にはUTF-16変換を通ったUCS-4の文字であり、特例的な扱い が必要である:UTF-16変換が行われていなければ、UCS-4の文字は、上記のよう に変換される。 The algorithm for encoding UCS-2 (or Unicode) to UTF-8 can be obtained from the above, in principle, by simply extending each UCS-2 character with two zero-valued octets. However, pairs of UCS-2 values between D800 and DFFF (surrogate pairs in Unicode parlance), being actually UCS-4 characters transformed through UTF-16, need special treatment: the UTF-16 transformation must be undone, yielding a UCS-4 character that is then transformed as above. UTF-8からUCS-4へのデコード手順は、下記の通り: Decoding from UTF-8 to UCS-4 proceeds as follows: 1)UCS-4の文字の4バイトを全て0に初期化する。 1) Initialize the 4 octets of the UCS-4 character with all bits set to 0. 2)数列のバイト長と、上記の表の第二の欄(x にマークされたビット)から、 文字値をエンコードしたビットを決定する。 2) Determine which bits encode the character value from the number of octets in the sequence and the second column of the table above (the bits marked x). 3)それらのビットをUCS-4文字に配分する。まず、数列の最後のバイトの下位 ビットから始め、左へ x のビットがなくなるまで続ける。 3) Distribute the bits from the sequence to the UCS-4 character, first the lower-order bits from the last octet of the sequence and proceeding to the left until no x bits are left. もし、UTF-8数列が、3バイト以上でないなら、このデコードによって、直接、 UCS-2が得られる。 If the UTF-8 sequence is no more than three octets long, decoding can proceed directly to UCS-2. 補足-実際の上記のデコードアルゴリズムの実装は、不正な数列がデコードされ ることを防止するべきである。例えば、配慮のない実装は、不正なUTF-8数列 C0 80 を(不適当にも)文字 U+0000 にデコードするかもしれない。それは、セ キュリティの問題を許し、且つ/または、他の問題を引き起こすかもしれない。 下記のセキュリティ配慮の章を参照すること。 NOTE -- actual implementations of the decoding algorithm above should protect against decoding invalid sequences. For instance, a naive implementation may (wrongly) decode the invalid UTF-8 sequence C0 80 into the character U+0000, which may have security consequences and/or cause other problems. See the Security Considerations section below. 更に、詳細なアルゴリズムと式は、[FSS_UTF],{UNICODE],[ISO-10646]の別紙R に記載されている。 A more detailed algorithm and formulae can be found in [FSS_UTF], [UNICODE] or Annex R to [ISO-10646]. 3.標準のバージョン 3. Versions of the standards ISO/IEC10646は、時折改版される。同様に、これが書かれた時点で、Unicode標 準にも1.0,1.1,2.0といった異なるバージョンが存在している。それぞれの新し いバージョンは以前のバージョンを置き換えるが、実装されたものや、特にデー タは、すぐには改版されない。 ISO/IEC 10646 is updated from time to time by published amendments; similarly, different versions of the Unicode standard exist: 1.0, 1.1 and 2.0 as of this writing. Each new version obsoletes and replaces the previous one, but implementations, and more significantly data, are not updated instantly. 一般に、変更は新しい文字を加えることなので、古いデータには問題を生じな い。ところが、IDO/IEC10646の改正5は、韓国語のハングル文字のブロックを移 動して拡張した。これによって、ハングル文字を含む全ての古いデータは、新し いバージョンの下では無効なものになってしまった。Unicode 2.0も、Unicode 1.1と同様の違いを持っている。この様な互換性のない変更を認める事に対する 公式な弁明は、ハングル文字を含んだ重要な実装やデータは存在しないという事 であった。これは事実である可能性が高いが、証明は不可能である。この事件 は、"韓国語の混乱"と名付けられた。適切な委員会は、再び互換性のない変更は 行わないことを約束した。 In general, the changes amount to adding new characters, which does not pose particular problems with old data. Amendment 5 to ISO/IEC 10646, however, has moved and expanded the Korean Hangul block, thereby making any previous data containing Hangul characters invalid under the new version. Unicode 2.0 has the same difference from Unicode 1.1. The official justification for allowing such an incompatible change was that no implementations and no data containing Hangul existed, a statement that is likely to be true but remains unprovable. The incident has been dubbed the "Korean mess", and the relevant committees have pledged to never, ever again make such an incompatible change. 新しいバージョン、特に互換性のない変更がもたらしたMIME charsetエンコード ラベルに関する結果については、5章で論じる。 New versions, and in particular any incompatible changes, have q conseuences regarding MIME character encoding labels, to be discussed in section 5. 4.例 4. Examples UCS-2の数列 "A." (0041, 2262, 0391, 002E)は、下 記のようにUTF-8にエンコードされる。 41 E2 89 A2 CE 91 2E The UCS-2 sequence "A." (0041, 2262, 0391, 002E) may be encoded in UTF-8 as follows: 41 E2 89 A2 CE 91 2E 韓国語の単語"hangugo"のハングル文字を表わしているUCS-2数列(D55C, AD6D, C5B4)は、下記のようにエンコードされる。 ED 95 9C EA B5 AD EC 96 B4 The UCS-2 sequence representing the Hangul characters for the Korean word "hangugo" (D55C, AD6D, C5B4) may be encoded as follows: ED 95 9C EA B5 AD EC 96 B4 日本語の単語"nihongo"の漢字を表わしているUCS-2の数列(65E5, 672C, 8A9E) は、下記のようにエンコードされる。 E6 97 A5 E6 9C AC E8 AA 9E The UCS-2 sequence representing the Han characters for the Japanese word "nihongo" (65E5, 672C, 8A9E) may be encoded as follows: E6 97 A5 E6 9C AC E8 AA 9E 5.MIME 登録 5. MIME registration このメモは、MIME 文字セットパラメータ (charset) [CHARSET-REG] の登録の基 盤としての役割を果たすことを意図している。提案された charset バラメータ は "UTF-8"である。この文字列は、最後の改正5(韓国語ブロック)までの全て の改正を含むISO/IEC10646の範囲の文字からなるテキストを含み、以上に概説さ れたエンコード方法を使ったバイト数列でエンコードされたメディアタイプを表 わしている。UTF-8は、MIME content typeのトップレベル"text"の下で使用する のに適している。 This memo is meant to serve as the basis for registration of a MIME character set parameter (charset) [CHARSET-REG]. The proposed charset parameter value is "UTF-8". This string labels media types containing text consisting of characters from the repertoire of ISO/IEC 10646 including all amendments at least up to amendment 5 (Korean block), encoded to a sequence of octets using the encoding scheme outlined above. UTF-8 is suitable for use in MIME content types under the "text" top-level type. "UTF-8"ラベルがISO/IEC10646全般に関連しており、バージョン識別を含んでい ないことに注目するべきである。これは、意図的なものであり、根拠は以下の通 りである: It is noteworthy that the label "UTF-8" does not contain a version identification, referring generically to ISO/IEC 10646. This is intentional, the rationale being as follows: MIME charsetは、受信したバイト数列を文字の羅列にに解釈する為に必要な情報 を提供するために設計されており、それ以上のものではない(RFC 2048 2.2章 in [MIME]を見よ)。文字セットが互換性なく変更されない限り、バージョン番号は 意味をなさない。なぜなら、受信された新しく割り当てられた知らない文字につ いて、タグからは何も知ることができないからである。タグはそれ自身では、と にかく受信されようとしている新しい文字について何も教えてはくれない。 A MIME charset label is designed to give just the information needed to interpret a sequence of bytes received on the wire into a sequence of characters, nothing more (see RFC 2045, section 2.2, in [MIME]). As long as a character set standard does not change incompatibly, version numbers serve no purpose, because one gains nothing by learning from the tag that newly assigned characters may be received that one doesn't know about. The tag itself doesn't teach anything about the new characters, which are going to be received anyway. だから、標準が互換性を持って進展する限り、バージョンを識別するラベルを持 つことの利点は、それだけのことである。しかし、バージョンに依存するラベル には欠点がある:古いアプリケーションが、新しい知らないラベルを伴ったデー タを受信すると、ラベルの認識に失敗し、データを扱うことが完全にできなくな るだろう。これに対して、知られているラベルは、一般には、新しい文字をまっ たく含んでいないデータについて、ほとんど正しい処理を引き起こすだろう。 Hence, as long as the standards evolve compatibly, the apparent advantage of having labels that identify the versions is only that, apparent. But there is a disadvantage to such version-dependent labels: when an older application receives data accompanied by a newer, unknown label, it may fail to recognize the label and be completely unable to deal with the data, whereas a generic, known label would have triggered mostly correct processing of the data, which may well not contain any new characters. "韓国語の混乱"(ISO/IEC 10646 改正5)は互換性のない変更であり、原理的に は、上に述べたようなバージョンに依存しないMIME charsetの適切性を否定す る。しかし、互換性の問題は、Unicode 1.1(改正5以前のISO/IEC 10464に等し い)に従ってエンコードされた韓国語のハングル文字を含むデータだけに現れ る。更に、議論の余地はあるが、この様な心配をするデータはないというのが、 互換性のない変更が容認された理由である。 Now the "Korean mess" (ISO/IEC 10646 amendment 5) is an incompatible change, in principle contradicting the appropriateness of a version independent MIME charset label as described above. But the compatibility problem can only appear with data containing Korean Hangul characters encoded according to Unicode 1.1 (or equivalently ISO/IEC 10646 before amendment 5), and there is arguably no such data to worry about, this being the very reason the incompatible change was deemed acceptable. 実際問題として、バージョンに依存しないラベルは、このラベルが改正5以降の 全てのバージョンを意味すると考えるなら、互換性のない変更が今後発生しなけ れば正当化される。将来のISO/IEC 10646のバージョンで互換性のない変更が行 われたなら、定義済みのMIME charsetは、それまでのバージョンに割り当て、 IETFの決定を他のラベルに決めればよい。 In practice, then, a version-independent label is warranted, provided the label is understood to refer to all versions after Amendment 5, and provided no incompatible change actually occurs. Should incompatible changes occur in a later version of ISO/IEC 10646, the MIME charset label defined here will stay aligned with the previous version until and unless the IETF specifically decides otherwise. ISO/IEC10646改正5を考慮してせずに(すなわち、改正5以前のコード割り当て を使用して)、UTF-8にエンコードしたハングル文節を含むテキストに限定的に する目的での"UNICODE-1-1-UTF-8"というcharsetパラメータも提案された。他の いかなるUTF-8データもこのラベルを使用すべきではない。ハングル文節を含ん でいないデータの場合は、特にそうである。更に、ISO/IEC10646改正5を考慮し ないハングルを含んだ新しいデータが、一切作成されないことを強く推奨するこ とが重要であると考える。 It is also proposed to register the charset parameter value "UNICODE-1-1-UTF-8", for the exclusive purpose of labelling text data containing Hangul syllables encoded to UTF-8 without taking into account Amendment 5 of ISO/IEC 10646 (i.e. using the pre-amendment 5 code point assignments). Any other UTF-8 data SHOULD NOT use this label, in particular data not containing any Hangul syllables, and it is felt important to strongly recommend against creating any new Hangul-containing data without taking Amendment 5 of ISO/IEC 10646 into account. 6.セキュリティへの考慮 6. Security Considerations UTF-8の実装者は、不正なUTF-8数列を扱う方法についての安全性を考慮する必要 がある。攻撃者が、UTF-16の文法で認められないバイト数列を送って、無謀な UTF-16パーサーを利用する状況が考えられる。 Implementors of UTF-8 need to consider the security aspects of how they handle illegal UTF-8 sequences. It is conceivable that in some circumstances an attacker would be able to exploit an incautious UTF-8 parser by sending it an octet sequence that is not permitted by the UTF-8 syntax. 特に、微妙な形式の攻撃がパーサーに対して実行されると、入力されたUTF-8に 対して、安全上重要な正当性チェックをパーサーが行なっても、不正なバイト数 列は文字と解釈される。例えば、パーサーは、1バイト長の00としてエンコード されていたときは、ヌル文字を禁止するかも知れないが、不正な2バイト数列の C0 80 を認めて、ヌル文字として解釈してしまうかもしれない。他の例としては、 バイト数列 2F 2E 2E 2F ("/../") は禁止するが、不正なバイト数列の 2F C0 AE 2E 2F は許可するかもしれない。 A particularly subtle form of this attack could be carried out against a parser which performs security-critical validity checks against the UTF-8 encoded form of its input, but interprets certain illegal octet sequences as characters. For example, a parser might prohibit the NUL character when encoded as the single-octet sequence 00, but allow the illegal two-octet sequence C0 80 and interpret it as a NUL character. Another example might be a parser which prohibits the octet sequence 2F 2E 2E 2F ("/../"), yet permits the illegal octet sequence 2F C0 AE 2E 2F. 受領確認 Acknowledgments The following have participated in the drafting and discussion of this memo: James E. Agenbroad Andries Brouwer Martin J. D|rst Ned Freed David Goldsmith Edwin F. Hart Kent Karlsson Markus Kuhn Michael Kung Alain LaBonte John Gardiner Myers Murray Sargent Keld Simonsen Arnold Winkler 文献目録 Bibliography [CHARSET-REG] Freed, N., and J. Postel, "IANA Charset Registration Procedures", BCP 19, RFC 2278, January 1998. [FSS_UTF] X/Open CAE Specification C501 ISBN 1-85912-082-2 28cm. 22p. pbk. 172g. 4/95, X/Open Company Ltd., "File System Safe UCS Transformation Format (FSS_UTF)", X/Open Preleminary Specification, Document Number P316. Also published in Unicode Technical Report #4. [ISO-10646] ISO/IEC 10646-1:1993. International Standard -- Information technology -- Universal Multiple-Octet Coded Character Set (UCS) -- Part 1: Architecture and Basic Multilingual Plane. Five amendments and a technical corrigendum have been published up to now. UTF-8 is described in Annex R, published as Amendment 2. UTF-16 is described in Annex Q, published as Amendment 1. 17 other amendments are currently at various stages of standardization. [MIME] Freed, N., and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045. N. Freed, N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046. K. Moore, "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text", RFC 2047. N. Freed, J. Klensin, J. Postel, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", RFC 2048. N. Freed, N. Borenstein, " Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples", RFC 2049. All November 1996. [RFC2152] Goldsmith, D., and M. Davis, "UTF-7: A Mail-safe Transformation Format of Unicode", RFC 1642, Taligent inc., May 1997. (Obsoletes RFC1642) [UNICODE] The Unicode Consortium, "The Unicode Standard -- Version 2.0", Addison-Wesley, 1996. [US-ASCII] Coded Character Set--7-bit American Standard Code for Information Interchange, ANSI X3.4-1986. Author's Address Francois Yergeau Alis Technologies 100, boul. Alexis-Nihon Suite 600 Montreal QC H4M 2P2 Canada Phone: +1 (514) 747-2547 Fax: +1 (514) 747-2561 EMail: fyergeau@alis.com Full Copyright Statement Copyright (C) The Internet Society (1998). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -- ここからは翻訳ではありません -- 翻訳の著作権表示 この翻訳の著作権は小林雅弘(bko)が保有します。 Copyright (C) bko 2000 但し、この事は、この翻訳の正確さをbkoが保証することを意味しませんし、こ の翻訳結果を利用した結果について保証することも意味しません。各自、自らの 責任で使用してください。 日本語と英語は、当然に一対一に対応するものではありませんので、この手の規 約・規格ものを翻訳するときは、全体を考慮して同一の英単語には同一の日本語 を割り当てて、意味を厳格にするなどの処置が必要かと思いますが、この翻訳は、 一切そういうことは行っておりません。ごくふつーの文章を訳すのと同一の作業 で翻訳しています。 従って、その分、わかりやすくなっている部分もあるように思いますが、厳格さ 明らかに欠落しています。利用される場合は、必ず原文と照らし合わせた上で利 用されることを推奨します。 誤訳等が発見された場合は、予告なく改変する場合がありますので、無断転載は お断りします。 初版 2000/6/8