RFC1843 日本語訳
1843 HZ - A Data Format for Exchanging Files of Arbitrarily MixedChinese and ASCII characters. F. Lee. August 1995. (Format: TXT=8787 bytes) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
英語原文
Network Working Group F. Lee Request for Comments: 1843 Stanford University Category: Informational August 1995
コメントを求めるワーキンググループF.リーの要求をネットワークでつないでください: 1843年のスタンフォード大学カテゴリ: 情報の1995年8月
HZ - A Data Format for Exchanging Files of Arbitrarily Mixed Chinese and ASCII characters
HZ--Arbitrarily Mixed中国人とASCII文字のExchanging FilesのためのData Format
Status of this Memo
このMemoの状態
This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind. Distribution of this memo is unlimited.
このメモはインターネットコミュニティのための情報を提供します。 このメモはどんな種類のインターネット標準も指定しません。 このメモの分配は無制限です。
Abstract
要約
The content of this memo is identical to an article of the same title written by the author on September 4, 1989. In this memo, GB stands for GB2312-80. Note that the title is kept only for historical reasons. HZ has been widely used for purposes other than "file exchange".
このメモの中身は1989年9月4日に作者によって書かれた同じタイトルに関する記事と同じです。 このメモでは、GBはGB2312-80を表します。 タイトルが単に歴史的な理由で保管されることに注意してください。 HZは「ファイル交換」を除いた目的に広く使用されました。
1. Introduction
1. 序論
Most existing computer systems which can handle a text file of arbitrarily mixed Chinese and ASCII characters use 8-bit codes. To exchange such text files through electronic mail on ASCII computer systems, it is necessary to encode them in a 7-bit format. A generic binary to ASCII encoder is not sufficient, because there is currently no universal standard for such 8-bit codes. For example, CCDOS and Macintosh's Chinese OS use different internal codes. Fortunately, there is a PRC national standard, GuoBiao (GB), for the encoding of Chinese characters, and Chinese characters encoded in the above systems can be easily converted to GB by a simple formula. (* The ROC standard BIG-5 is outside the scope of this article.)
任意に複雑な中国人とASCII文字のテキストファイルを扱うことができるほとんどの既存のコンピュータ・システムが8ビットのコードを使用します。 電子メールを通してそのようなテキストファイルをASCIIコンピュータ・システムと交換するために、7ビットの形式でそれらをコード化するのが必要です。 現在、そのような8ビットのコードの世界基準が全くないので、ASCIIエンコーダへの一般的なバイナリーは十分ではありません。 例えば、CCDOSとマッキントッシュの中国のOSは異なった内部のコードを使用します。 幸い、PRC国家規格があります、GuoBiao(GB)、漢字のコード化のために、そして、簡単な公式で容易に上のシステムでコード化された漢字はGBに変換できます。 (*この記事の範囲の外にROCの標準のBIG-5があります。)
HZ is a 7-bit data format proposed for arbitrarily mixed GB and ASCII text file exchange. HZ is also intended for the design of terminal emulators that display and edit mixed Chinese and ASCII text files in real time.
HZは任意に複雑なGBのために提案された7ビットのデータ形式とASCIIテキスト・ファイル交換です。 また、HZはリアルタイムで複雑な中国語とASCIIテキスト・ファイルを表示して、編集する端末エミュレータのデザインのために意図します。
Lee Informational [Page 1] RFC 1843 HZ - A Data Format for Exchanging Files August 1995
リー情報[1ページ]のRFC1843HZ--1995年8月にファイルを交換するためのデータの形式
2. Specification
2. 仕様
The format of HZ is described in the following.
HZの形式は以下で説明されます。
Without loss of generality, we assume that all Chinese characters (HanZi) have already been encoded in GB. A GB (GB1 and GB2) code is a two byte code, where the first byte is in the range $21-$77 (hexadecimal), and the second byte is in the range $21-$7E.
一般性の喪失がなければ、私たちは、すべての漢字(HanZi)がGBで既にコード化されたと思います。 1GB(GB1とGB2)コードは2バイトコードです、そして、2番目のバイトが範囲に21ドル7ドルのEであります。そこに、最初のバイトが範囲に21ドル77ドル(16進)あります。
A graphical ASCII character is a byte in the range $21-$7E. A non- graphical ASCII character is a byte in the range $0-$20 or of the value $7F.
グラフィカルなASCII文字は21ドル7ドルのE範囲の1バイトです。 非グラフィカルなASCII文字は7ドルのF0ドルから20ドルか価値の範囲の1バイトです。
Since the range of a graphical ASCII character overlaps that of a GB byte, a byte in the range $21-$7E is interpreted according to the mode it is in. There are two modes, namely ASCII mode and GB mode.
グラフィカルなASCII文字の範囲がGBバイトのものを重ね合わせるので、それがあるモードによると、範囲では、1バイト、21ドルから7ドルへのEが解釈されます。 2つのモードがあって、すなわち、ASCIIは、モードとGBモードです。
By convention, a non-graphical ASCII character should only appear in ASCII mode.
コンベンションで、非グラフィカルなASCII文字はASCIIモードで現れるだけであるべきです。
The default mode is ASCII mode.
デフォルトモードはASCIIモードです。
In ASCII mode, a byte is interpreted as an ASCII character, unless a '~' is encountered. The character '~' is an escape character. By convention, it must be immediately followed ONLY by '~', '{' or '\n' (<LF>), with the following special meaning.
ASCIIモードで、'~'が遭遇しない場合、1バイトはASCII文字として解釈されます。 キャラクタ'~'は拡張文字です。 コンベンションが'~'だけ、がすぐにそれのあとに続かなければならない、'、'以下の特別な意味がある'\n'(<LF>)。
o The escape sequence '~~' is interpreted as a '~'. o The escape-to-GB sequence '~{' switches the mode from ASCII to GB. o The escape sequence '~\n' is a line-continuation marker to be consumed with no output produced.
o 'エスケープシーケンス'~~'は'~'. ○ GBへのエスケープ系列として解釈される'~、'スイッチ、GB○ ASCIIからエスケープシーケンス'~\n'までのモードは出力が全く起こされていなく消費されるべき線継続マーカーです。
In GB mode, characters are interpreted two bytes at a time as (pure) GB codes until the escape-from-GB code '~}' is read. This code switches the mode from GB back to ASCII. (Note that the escape- from-GB code '~}' ($7E7D) is outside the defined GB range.)
'GBからのエスケープまでの(純粋な)GBコードが'~、をコード化するときGBモードで、キャラクタが一度に2バイト解釈される、'読まれます。 このコードはGBからASCIIにモードを切り換えて戻します。 '、(エスケープがGBから'~、をコード化することに注意してください、'(7ドルのE7D) 定義されたGB範囲の外にあります。)
The decoding process is clear from the above description.
解読過程は上の記述によって明確です。
The encoding process is straightforward. Note that an (ASCII) '~' is always encoded as '~~'. A sequence of GB codes is enclosed in '~{' and '~}'.
コード化の過程は簡単です。 '(ASCII)'~'が'~~'としていつもコード化されることに注意してください。 'GBコードの系列が'~に同封される、''~、'
Lee Informational [Page 2] RFC 1843 HZ - A Data Format for Exchanging Files August 1995
リー情報[2ページ]のRFC1843HZ--1995年8月にファイルを交換するためのデータの形式
3. Remarks & Recommendations
3. 所見と推薦
We choose to encode any ASCII character except '~' as it is, rather than as a two byte code, and we choose ASCII as the default mode for the following reasons. The computer systems we use is ASCII based. A HZ file containing pure ASCII characters (i.e. no Chinese characters) except '~' is precisely a pure ASCII file. In general, the English (ASCII) portion of a HZ file is directly readable.
私たちは、むしろ2バイトコードより'~'それ以外のどんなASCII文字もコード化するのを選びます、そして、以下の理由によるデフォルトモードとしてASCIIを選びます。 私たちが使用するコンピュータ・システムは基づくASCIIです。 '~'を除いて、純粋なASCII文字(すなわち、漢字がありません)を含むHZファイルは正確に純粋なASCIIファイルです。 一般に、HZファイルのイギリスの(ASCII)部分は直接読み込み可能です。
The escape character '~' is chosen not only because it is commonly used in the ASCII world, but also because '~' ($7E) is outside the defined range ($21-$77) of the first byte of a GB code.
単にそれがASCII世界で一般的に使用されるので選ばれているのではなく、GBコードの最初のバイトの定義された範囲(21ドルから77ドル)の外に'~'(7ドルのE)がまたあるので、'~'という拡張文字は選ばれています。
In ASCII mode, other potential escape sequences, i.e., two byte sequences beginning with '~' (other than '~~', '~{', '~\n') are currently invalid HZ sequences. Hence, they can be used for future extension of HZ with total upward compatibility.
現在無効のHZ系列はそうです。'ASCIIモード、他の潜在的エスケープシーケンス、すなわち、'~で始まる2つのバイト列'、('~~'、'、~、'、'、~\n') したがって、総上位互換性があるHZの今後の拡大にそれらは使用できます。
The line-continuation marker '~\n' is useful if one wants to encode long lines in the original text into short lines in this data format without introducing extra newline characters in the decoding process.
'人が原本で解読過程で余分なニューラインキャラクタを紹介しないでこのデータの形式の短い線に長い線をコード化したいなら、線継続マーカー'~\n'は役に立ちます。
There is no limit on the length of a line. In fact, the whole file could be one long line or even contain no newline characters. Any DECODER of this HZ data format should not and has no need to operate on the concept of a line.
限界が全く線の長さにありません。 事実上、全体のファイルは、1つの長い線であるかニューラインキャラクタを全く含むことさえできませんでした。 そして、このHZデータの形式のどんなDECODERもそうするべきでない、いいえは、線の概念で操作する必要があらせます。
It is easy to write encoders and decoders for HZ. An encoder or decoder needs to lookahead at most one character in the input data stream.
HZのためにエンコーダとデコーダを書くのは簡単です。 エンコーダかデコーダが入力データ・ストリームで高々先読みに1つのキャラクタを必要とします。
Given the current mode, it is also possible and easy to decode a HZ data stream by scanning backward. One of the implication is that "backspaces" can be handled correctly by a terminal emulator.
現在のモードを考えて、後方にスキャンすることによってHZデータ・ストリームを解読するのは、また、可能であって、簡単です。 含意の1つは端末エミュレータで正しく「バックスペースキー」を扱うことができるということです。
To facilitate the effective use of programs supporting line/page skips such as "more" on UNIX with a terminal emulator understanding the HZ format, it is RECOMMENDED that the ENCODER (which outputs in HZ) sets a maximum line size of less than 80 characters. Since '\n' is an ASCII character, the syntax of HZ then automatically implies that GB codes appearing at the end of a line must be terminated with the escape-from-GB code '~}', and the line-continuation marker '~\n' should be inserted appropriately. The price to paid is that the encoded file size is slightly larger.
プログラムのHZ形式を理解しながら端末エミュレータで「さらに」UNIXなどの線/ページスキップを支持する有効な使用を容易にするために、ENCODER(HZでのどの出力)が80未満のキャラクタの最大の線サイズを設定するかは、RECOMMENDEDです。 次に、HZの構文が、''\n'がASCII文字であるのでGBからのエスケープコード'~で線の端に現れるGBコードを終えなければならないのを自動的に含意する、'線継続マーカー'~\n'は適切に挿入されるべきです。 支払われることへの価格はコード化されたファイルサイズがわずかに大きいということです。
It is important to understand the following distinction. Note that the above recommendation does NOT change the HZ format. It is simply an encoding "style" which follows the syntax of HZ. Note that this
以下の区別を理解しているのは重要です。 上の推薦がHZ形式を変えないことに注意してください。 それは単にHZの構文に従うコード化「スタイル」です。 それに注意してください、これ
Lee Informational [Page 3] RFC 1843 HZ - A Data Format for Exchanging Files August 1995
リー情報[3ページ]のRFC1843HZ--1995年8月にファイルを交換するためのデータの形式
"style" is not built into HZ. It is an additional convention built "on top of" HZ. Other applications may require different "styles", but the same basic HZ DECODER will always work. The essence of HZ is to provide such a flexible basic data format for files of arbitrarily mixed Chinese and ASCII characters.
HZは「スタイル」に組み込まれません。 それはHZ「上」に建てられた追加コンベンションです。 他のアプリケーションは異なった「スタイル」を必要とするかもしれませんが、同じ基本的なHZ DECODERはいつも働くでしょう。 HZの本質は任意に複雑な中国人とASCII文字のファイルにそのようなフレキシブルな基本的なデータの形式を供給することです。
4. Examples
4. 例
To illustrate the "stylistic" issue of HZ encoding, we give the following four examples of encoded text, which should produce the same decoded output. (The recommendation in the last section refers to Example 2.)
HZコード化の「文体上」の問題を例証するために、私たちはコード化されたテキストに関する以下の4つの例を出します。(テキストは同じ解読された出力を起こすべきです)。 (最後のセクションの推薦はExample2について言及します。)
Example 1: (Suppose there is no line size limit.) This sentence is in ASCII. The next sentence is in GB.~{<:Ky2;S{#,NpJ)l6HK!#~}Bye.
例1: (線サイズ限界が全くないと仮定してください。) ASCIIにはこの文があります。 次の文がGB~にある、<: Ky2;、S、NpJ) #、l6HK!#~、さようなら。
Example 2: (Suppose the maximum line size is 42.) This sentence is in ASCII. The next sentence is in GB.~{<:Ky2;S{#,~}~ ~{NpJ)l6HK!#~}Bye.
例2: (最大の線サイズが42であると仮定してください。) ASCIIにはこの文があります。 次の文がGB~にある、<: Ky2;、S、#、~、~~、NpJ) l6HK!#~、さようなら。
Example 3: (Suppose a new line is started whenever there is a mode switch.) This sentence is in ASCII. The next sentence is in GB.~ ~{<:Ky2;S{#,NpJ)l6HK!#~}~ Bye.
例3: (モード・スイッチがあるときはいつも、復帰改行が始動されると仮定してください。) ASCIIにはこの文があります。 次の文がGB~~にある、<: Ky2;、S、NpJ) #、l6HK!#~、~Bye。
Acknowledgement
承認
Edmund Lai was the first one who brought my attention to this topic. Discussions with Ed, Tin-Fook Ngai, Yagui Wei and Ricky Yeung were very helpful in shaping the ideas in this article. Thanks to Tin-Fook for his careful review of the draft and numerous interesting suggestions.
エドモンド・レイは私の留意をこの話題に向けた最初の人でした。 エド、Tin-Fook Ngai、Yaguiウェイ、およびリッキーYeungとの議論はこの記事の考えを形成する際に非常に役立っていました。 彼の草稿と頻繁なおもしろい提案の慎重なレビューをTin-Fookをありがとうございます。
References
参照
[1] Fung Fung Lee, "HZ - A Data Format for Exchanging Files of Arbitrarily Mixed Chinese and ASCII Characters," September 4, 1989. As part of //ftp.ifcss.org/software/unix/convert/HZ-2.0.tar.gz
[1] フォンフォンLee、「HZ--交換のためのデータの形式は任意に複雑な中国語とASCIIキャラクターをファイルする」、1989年9月4日。 //ftp.ifcss.org/software/unix/convert/HZ-2.0.tar.gzの一部として
Security Considerations
セキュリティ問題
Security issues are not addressed in this memo.
安全保障問題はこのメモに記述されません。
Lee Informational [Page 4] RFC 1843 HZ - A Data Format for Exchanging Files August 1995
リー情報[4ページ]のRFC1843HZ--1995年8月にファイルを交換するためのデータの形式
Author's Address
作者のアドレス
Fung Fung Lee Computer Systems Laboratory Stanford University Stanford, CA 94309
フォンフォンリーコンピュータシステム研究所のスタンフォード大学のスタンフォード、カリフォルニア 94309
Phone: +1 415 723 1450 EMail: lee@csl.stanford.edu
以下に電話をしてください。 +1 1450年の415 723メール: lee@csl.stanford.edu
Lee Informational [Page 5]
リーInformationalです。[5ページ]
一覧
スポンサーリンク