Network Working Group
Request for Comments: 1468
Japanese Character Encoding for Internet Messages
インターネットメッセージのための日本語文字エンコーディング(「ISO-2022-JP」について)
Status of this Memo
このメモの位置づけ
This memo provides information for the Internet community. It does not specify an Internet standard. Distribution of this memo is unlimited.
このメモはインターネットコミュニティに情報を提供します。インターネット標準は指定しません。このメモの配布は無制限です。
Introduction
はじめに
This document describes the encoding used in electronic mail [RFC822] and network news [RFC1036] messages in several Japanese networks. It was first specified by and used in JUNET [JUNET]. The encoding is now also widely used in Japanese IP communities.
この文書はいくつかの日本のネットワークの中の電子メール[RFC822]とネットワークニュース[RFC1036]メッセージの中で使われたエンコーディングを説明します。それはJUNET[JUNET]で最初に指定され、使われました。エンコーディングは現在また日本のIPコミュニティで広く使われます。
The name given to this encoding is "ISO-2022-JP", which is intended to be used in the "charset" parameter field of MIME headers (see [MIME1] and [MIME2]).
このエンコーディングに与えられた名前は、「ISO-2022-JP」(それは、MIMEヘッダー([MIME1]と[MIME2]を見てください)の「charset」パラメータフィールドで使われることを意図しています)です。
index
目次
Description
説明
The text starts in ASCII [ASCII], and switches to Japanese characters through an escape sequence. For example, the escape sequence ESC $ B (three bytes, hexadecimal values: 1B 24 42) indicates that the bytes following this escape sequence are Japanese characters, which are encoded in two bytes each. To switch back to ASCII, the escape sequence ESC ( B is used.
テキストはASCII[ASCII]で始めて、エスケープシーケンスを通して日本語の文字に切り換えます。例えば、エスケープシーケンスESC $ B(3バイト、16進値:1B 24 42)は、このエスケープシーケンスに続いているバイトが日本語の文字であることを示します(続く文字はそれぞれ2文字としてエンコードされます)。エスケープシーケンスESC(Bは日本語文字列の後ろでASCIIに切り換えるために使われます。
The following table gives the escape sequences and the character sets used in ISO-2022-JP messages. The ISOREG number is the registration number in ISO's registry [ISOREG].
以下のテーブルはISO-2022-JPメッセージの中で使われたエスケープシーケンスと文字セットを与えます。ISOREG番号はISOのレジストリー[ISOREG]中での登録番号です。
Esc Seq Character Set ISOREG ESC ( B ASCII 6 ESC ( J JIS X 0201-1976 ("Roman" set) 14 ESC $ @ JIS X 0208-1978 42 ESC $ B JIS X 0208-1983 87
Note that JIS X 0208 was called JIS C 6226 until the name was changed on March 1st, 1987. Likewise, JIS C 6220 was renamed JIS X 0201.
JIS X 0208は1987年3月1日に名前が変更されるまで、JIS C 6226と呼ばれていたことに注意してください。同様に、JIS C 6220はJIS X 0201に改名されました。
The "Roman" character set of JIS X 0201 [JISX0201] is identical to ASCII except for backslash (\) and tilde (~). The backslash is replaced by the Yen sign, and the tilde is replaced by overline. This set is Japan's national variant of ISO 646 [ISO646].
JIS X 0201 [JISX0201]の「ローマ字」文字セットはバックスラッシュ(\)とティルデ(~)を除いてASCIIと同一です。バックスラッシュは円記号によって、ティルデはオーバーラインによって取り替えられます。このセットはISO646[ISO646]の日本の全国的なバリエーションです。
The JIS X 0208 [JISX0208] character sets consist of Kanji, Hiragana, Katakana and some other symbols and characters. Each character takes up two bytes.
JIS X 0208 [JISX0208]文字セットは漢字、平仮名、カタカナ、および他のシンボルと文字から成ります。各文字は2バイトを取り上げます。
For further details about the JIS Japanese national character set standards, refer to [JISX0201] and [JISX0208]. For further information about the escape sequences, see [ISO2022] and [ISOREG].
JIS日本人全国文字セット標準についてのさらなる詳細のために、[JISX0201]と[JISX0208]を参照してください。エスケープシーケンスについての詳細について、[ISO2022]と[ISOREG]を見てください。
If there are JIS X 0208 characters on a line, there must be a switch to ASCII or to the "Roman" set of JIS X 0201 before the end of the line (i.e., before the CRLF). This means that the next line starts in the character set that was switched to before the end of the previous line.
行の中にJIS X 0208文字または「ローマ字」(JIS X 0201文字セット)があるならば、ASCIIへの切り替えスイッチが行の終わり(すなわちCRLFの前)の前になければなりません。 これは、次の行が前の行の終わりまでに切り換えられた文字の組で開始することを意味します。
Also, the text must end in ASCII.
また、テキストはASCIIで終わらなければなりません。
Other restrictions are given in the Formal Syntax below.
他の制限は正式な構文の中で下に与えられます。
Formal Syntax
正式な構文
The notational conventions used here are identical to those used in RFC 822 [RFC822].
ここで使われた表記法はRFC 822[RFC822]中で使われたものと同一です。
The * (asterisk) convention is as follows:
*(アスタリスク)の慣例は次の通りです:
l*m something
meaning at least l and at most m somethings, with l and m taking default values of 0 and infinity, respectively.
somethingsがl以上m以下繰り返すことを意味し、デフォルト値はそれぞれ0と無限大です。
message = headers 1*( CRLF *single-byte-char *segment single-byte-seq *single-byte-char ) ; see also [MIME1] "body-part" ; note: must end in ASCII ;[MIME1]「ボディ部分」注を見てください ;注:ASCIIで終わらなければなりません headers = <see [RFC822] "fields" and [MIME1] "body-part"> ;[RFC822]「フィールド」とMIME1「ボディ部分」を見てください。 segment = single-byte-segment / double-byte-segment single-byte-segment = single-byte-seq 1*single-byte-char double-byte-segment = double-byte-seq 1*( one-of-94 one-of-94 ) single-byte-seq = ESC "(" ( "B" / "J" ) double-byte-seq = ESC "$" ( "@" / "B" ) CRLF = CR LF ; ( Octal, Decimal., Hex.) ESC = <ISO 2022 ESC, escape> ; ( 33, 27. 1B.) SI = <ISO 2022 SI, shift-in> ; ( 17, 15. 0F.) SO = <ISO 2022 SO, shift-out> ; ( 16, 14. 0E.) CR = <ASCII CR, carriage return>; ( 15, 13. 0D.) LF = <ASCII LF, linefeed> ; ( 12, 10. 0A.) one-of-94 = <any one of 94 values> ; (41-176, 33.-126. 21-7E.) 7BIT = <any 7-bit value> ; ( 0-177, 0.-127. 0-7F.) ; (訳注:原文にHex表記はありません) single-byte-char = <any 7BIT, including bare CR & bare LF, but NOT including CRLF, and not including ESC, SI, SO> ; 単独のCRまたはLFを含むけれどもCRLFを含まず、 ; ESC、SI SOを含まない全ての7ビット
MIME Considerations
MIME考慮
The name given to the JUNET character encoding is "ISO-2022-JP". This name is intended to be used in MIME messages as follows:
JUNET文字エンコーディングに与えられた名前は「ISO-2022-JP」です。この名前は、次の通りMIMEメッセージの中で使われることを意図しています:
Content-Type: text/plain; charset=iso-2022-jp
The ISO-2022-JP encoding is already in 7-bit form, so it is not necessary to use a Content-Transfer-Encoding header. It should be noted that applying the Base64 or Quoted-Printable encoding will render the message unreadable in current JUNET software.
ISO-2022-JPエンコーディングはすでに7ビットのフォームにあるので、内容転送エンコーディングヘッダーを使うことは必要ではありません。Base64またはQuoted-Printableエンコーディングを適用することがメッセージを現在のJUNETソフトウェアの中で読む価値のなくするであろうということは注目されるべきです。
ISO-2022-JP may also be used in MIME Part 2 headers. The "B" encoding should be used with ISO-2022-JP text.
ISO-2022-JPはまたMIMEパート2ヘッダーの中で使われるかもしれません。「B」エンコーディングはISO-2022-JPテキストによって使われるべきです。
Background Information
予備知識
The JUNET encoding was described in the JUNET User's Guide [JUNET] (JUNET Riyou No Tebiki Dai Ippan).
JUNETエンコーディングはJUNETユーザーズガイド[JUNET](JUNET利用の手引き第1版)中で説明されました。
The encoding is based on the particular usage of ISO 2022 announced by 4/1 (see [ISO2022] for details). However, the escape sequence normally used for this announcement is not included in ISO-2022-JP messages.
エンコーディングは、4/1(詳細は[ISO2022]を見てください)によって発表されたISO-2022の特定の用法に基づきます。しかし、この発表のために正常に使われたエスケープシーケンスはISO-2022-JPメッセージに含められていません。
The Kana set of JIS X 0201 is not used in ISO-2022-JP messages.
JIS X 0201の仮名セット(訳注:俗に言う「半角カタカナ」)はISO-2022-JPメッセージの中で使われません。
In the past, some systems erroneously used the escape sequence ESC ( H in JUNET messages. This escape sequence is officially registered for a Swedish character set [ISOREG], and should not be used in ISO- 2022-JP messages.
過去に、いくつかのシステムは誤ってJUNETメッセージの中でエスケープシーケンスESC( H を使いました。このエスケープシーケンスはスウェーデン文字セット[ISOREG]に公式に登録されて、ISO-2022-JPメッセージの中で使われるべきでありません。
Some systems do not distinguish between ESC ( B and ESC ( J or between ESC $ @ and ESC $ B for display. However, when relaying a message to another system, the escape sequences must not be altered in any way.
いくつかのシステムは ESC( B と ESC( J やESC $ @ と ESC $ B を表示のために区別していません。しかし、メッセージを別のシステムに中継する時に、エスケープシーケンスはどのような点でも変更されてはなりません。
The human user (not implementor) should try to keep lines within 80 display columns, or, preferably, within 75 (or so) columns, to allow insertion of ">" at the beginning of each line in excerpts. Each JIS X 0208 character takes up two columns, and the escape sequences do not take up any columns. The implementor is reminded that JIS X 0208 characters take up two bytes and should not be split in the middle to break lines for displaying, etc.
人間のユーザ(作成者でない)は、80の表示列以内か望ましくは75列の中に1行を保って、それぞれの行の始めに抜粋で「>」の挿入を許そうとするべきです。 それぞれのJIS X0208文字は2つのカラムを取ります、そして、エスケープシーケンスはどんなカラムも取りません。 作成者にJIS X0208キャラクタが2バイトを取るのを思い出させて、表示などのために改行などにより途中で分けるべきではありません。
The JIS X 0208 standard was revised in 1990, to add two characters at the end of the table. Although ISO 2022 specifies special additional escape sequences to indicate the use of revised character sets, it is suggested here not to make use of this special escape sequence in ISO-2022-JP text, even if the two characters added to JIS X 0208 in 1990 are used.
JIS X 0208標準は、2字をテーブルの終わりに追加するために1990年に改訂されました。改訂された文字セットの使用を示すために、ISO 2022が特別な追加のエスケープシーケンスを指定しましたが、それは、1990年にJIS X 0208に追加された2字が使われてもISO-2022-JPテキストの中のこの特別なエスケープシーケンスを利用しないようにここに提案されます。
For further information about Japanese character encodings such as PC codes, FTP locations of implementations, etc, see "Electronic Handling of Japanese Text" [JPN.INF].
インプリメンテーションのPCコード、FTP位置などなどの日本語の文字エンコーディングについての詳細は、「日本語テキストの電子取り扱い」[JPN.INF]を見てください。
References
参考文献
- [ASCII] American National Standards Institute, "Coded character set -- 7-bit American national standard code for information interchange", ANSI X3.4-1986.
- [ISO646] International Organization for Standardization (ISO), "Information technology -- ISO 7-bit coded character set for information interchange", International Standard, Ref. No. ISO/IEC 646:1991.
- [ISO2022] International Organization for Standardization (ISO), "Information processing -- ISO 7-bit and 8-bit coded character sets -- Code extension techniques", International Standard, Ref. No. ISO 2022-1986 (E).
- [ISOREG] International Organization for Standardization (ISO), "International Register of Coded Character Sets To Be Used With Escape Sequences".
- [JISX0201] Japanese Standards Association, "Code for Information Interchange", JIS X 0201-1976.
- [JISX0208] Japanese Standards Association, "Code of the Japanese graphic character set for information interchange", JIS X 0208-1978, -1983 and -1990.
- [JPN.INF] Ken R. Lunde <lunde@adobe.com>, "Electronic Handling of Japanese Text", March 1992, msi.umn.edu(128.101.24.1):pub/lunde/japan[123].inf
- [JUNET] JUNET Riyou No Tebiki Sakusei Iin Kai (JUNET User's Guide Drafting Committee), "JUNET Riyou No Tebiki (Dai Ippan)" ("JUNET User's Guide (First Edition)"), February 1988.
- [MIME1] Borenstein N., and N. Freed, "MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1341, Bellcore, Innosoft, June 1992.
- [MIME2] Moore, K., "Representation of Non-ASCII Text in Internet Message Headers", RFC 1342, University of Tennessee, June 1992.
- [RFC822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, UDEL, August 1982.
- [RFC1036] Horton M., and R. Adams, "Standard for Interchange of USENET Messages", RFC 1036, AT&T Bell Laboratories, Center for Seismic Studies, December 1987.
Acknowledgements
確認
Many people assisted in drafting this document. The authors wish to thank in particular Akira Kato, Masahiro Sekiguchi and Ken'ichi Handa.
多くの人々は、この文書を製図することを補助しました。作者は、特にアキラ・カトウ、マサヒロ・セキグチ、およびケンイチ・ハンダに感謝することを望みます。
Security Considerations
セキュリティ対策
Security issues are not discussed in this memo.
セキュリティ問題はこのメモにおいて議論されません。
Authors' Addresses
奥付
- Jun Murai
- Keio University
5322 Endo, Fujisawa
Kanagawa 252 Japan
Fax: +81 466 49 1101
EMail: jun@wide.ad.jp
- Mark Crispin
- Panda Programming
6158 Lariat Loop NE
Bainbridge Island, WA 98110-2098
USA
Phone: +1 206 842 2385
EMail: MRC@PANDA.COM
- Erik M. van der Poel
- A-105 Park Avenue
4-4-10 Ohta, Kisarazu
Chiba 292 Japan
Phone: +81 438 22 5836
Fax: +81 438 22 5837
EMail: erik@poel.juice.or.jp