JPH0398113A - 1-byte/2-byte character string bidirectional conversion system - Google Patents

1-byte/2-byte character string bidirectional conversion system

Info

Publication number
JPH0398113A
JPH0398113A JP1236542A JP23654289A JPH0398113A JP H0398113 A JPH0398113 A JP H0398113A JP 1236542 A JP1236542 A JP 1236542A JP 23654289 A JP23654289 A JP 23654289A JP H0398113 A JPH0398113 A JP H0398113A
Authority
JP
Japan
Prior art keywords
byte
conversion
character string
record
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1236542A
Other languages
Japanese (ja)
Inventor
Masuaki Iwata
岩田 益明
Kazunari Shimizu
清水 和成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP1236542A priority Critical patent/JPH0398113A/en
Publication of JPH0398113A publication Critical patent/JPH0398113A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To facilitate the conversion from a 1-byte/2-byte character string to a 2-byte/1-byte character string and vice versa by using a 1-byte/2-byte conversion table and a converting direction setting switch. CONSTITUTION:A CPU 11 is provided together with a main storage 12, an input device 13, an input control part 14 which controls the read of the device 13 in response to a command given from the CPU 11, and an output control part 16 which controls the write of an output device 15 with a command given from the CPU 11. Furthermore a converting direction setting switch 17 is added to decide the 1-byte/2-byte character string conversion or vice versa together with a 1-byte/2-byte conversion table 18 which contains the 2-byte characters corresponding to the 1-byte characters respectively. By such a constitution, the 1-byte/2-byte and 2-byte/1-byte bidirectional conversion is facilitated.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は1バイト2バイト文字列双方向変換方式、特に
プリンタ等の出力装置に用いられる1バイト2バイト文
字列双方向変換方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a 1-byte 2-byte character string bidirectional conversion method, and particularly to a 1-byte 2-byte character string bidirectional conversion method used in an output device such as a printer.

〔従来の技術〕[Conventional technology]

一般に情報処理に用いられる出力装置であるプリンタに
おいては、物理的制約から2バイトで表現される文字を
印字できないものがある。また何れの機種においても横
1行に印字列数に上限があり、この上限は印字する文字
の種類によって異なり、通常は2バイト系全角文字、1
バイト系文字、2バイト系半角文字の順で上限の数は大
きくなる。従って2バイト系文字で構成されたレコード
をそのまま横1行で印字できないといったことが発生す
る。そこで2バイト系文字列をを1バイト系文字列に変
換すればよいが、文字を構成するコード体系において1
バイト系文字コードと2バイト系文字との間に、通常は
一定の変換規則がなく、単なる計算処理によって文字コ
ードの変換ができなく、プリンタ等において1バイト2
バイト文字列相互変換を行なっているものがない。
Some printers, which are output devices generally used for information processing, cannot print characters expressed in 2 bytes due to physical limitations. In addition, each model has an upper limit to the number of print lines per horizontal line, and this upper limit varies depending on the type of characters to be printed, usually 2-byte full-width characters, 1-byte characters,
The upper limit number increases in the order of byte characters and double-byte half-width characters. Therefore, a record composed of double-byte characters cannot be printed as is in one horizontal line. Therefore, you can convert the 2-byte character string to a 1-byte character string, but in the code system that makes up the characters,
There are usually no fixed conversion rules between byte-based character codes and 2-byte characters, and character codes cannot be converted by simple calculation processing, so printers, etc.
There is nothing that performs byte string mutual conversion.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述したように従来は、単純な計算処理では1バイト系
文字と2バイト系文字との相互変換ができないので、印
字装置を保有しているにも拘らず、文字列印字にII行
の文字数制限に有利な1バイト系文字列への変換使用を
断念してしまうという欠点がある. 〔課題を解決するための手段〕 本発明のlバイト2バイト文字列双方向変換方式は、第
1図に本発明の構成図を示すように、1バイトで表現さ
れる文字のみで構成されたレコード、あるいは2バイト
で表現される文字のみで構成されたレコードをレコード
単位で入力レコードバッファへ読込む入力手段1と、こ
の入力レコードバッファ中の文字列を先頭から順次変換
用入力バッファへ移送する変換用入力バッファ登録手段
2と、1バイト系文字列を2バイト系文字列へ変換する
のかあるいは2バイト系文字列を1バイト系文字列に変
換するのかを設定するスイッチにより変換方向を判断す
る変換方向判断手段3と、■バイト系文字のそれぞれに
対応した2バイト系文字を持つ1バイト2バイト変換テ
ーブルを検索して変換用入力バッファ中の文字に対応し
た1バイトまたは2バイトで表現される文字を選択し、
変換用出力バッファへ出力する1バイト2バイト変換テ
ーブル検索手段4と、得られた変換後の文字を変換用出
力バッファから出力レコードバッファへ順次格納する出
力レコードバッファ登録手段5と、変換後の文字列が格
納された出力レコードバッファから文字列をレコード単
位で出力する出力手段6とを有することにより構成され
る.〔実施例〕 次に本発明の実施例について図面を参照して説明する。
As mentioned above, in the past, it was not possible to mutually convert between 1-byte characters and 2-byte characters through simple calculation processing, so despite having a printing device, there was a limit on the number of characters in line II for character string printing. The disadvantage is that it abandons the advantageous use of converting to a 1-byte string. [Means for Solving the Problems] The bidirectional conversion method for l-byte and 2-byte character strings of the present invention is as shown in FIG. 1, which is a block diagram of the present invention. Input means 1 reads a record or a record consisting only of characters expressed in 2 bytes into an input record buffer record by record, and sequentially transfers character strings in this input record buffer from the beginning to an input buffer for conversion. The conversion direction is determined by the conversion input buffer registration means 2 and a switch that sets whether to convert a 1-byte character string to a 2-byte character string or a 2-byte character string to a 1-byte character string. The conversion direction determining means 3 searches the 1-byte 2-byte conversion table that has 2-byte characters corresponding to each of the byte-based characters, and determines which characters are expressed in 1-byte or 2-byte characters corresponding to the characters in the input buffer for conversion. Select the characters you want,
1-byte 2-byte conversion table search means 4 for outputting to the conversion output buffer, output record buffer registration means 5 for sequentially storing the obtained converted characters from the conversion output buffer to the output record buffer, and the converted characters. It is constructed by having an output means 6 for outputting character strings in units of records from an output record buffer in which strings are stored. [Example] Next, an example of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例のブロック図で、中央処理装
置11と、主記憶装置12と、入力装置l3と、中央処
理装置11からの指令に応じて入力装置13の読込みを
制御する入力制御部14と、出力装置15と、中央処理
装置11からの指令に応じて出力装置15の書出しを制
御する出力制御部16と、1バイト系文字から2バイト
系文字に変換するのかあるいは2バイト系文字から1バ
イト系文字に変換するのか設定する変換方向設定スイッ
チ17と、1バイト系文字それぞれに対応した2バイト
系文字を持つ1バイト2バイト変換テーブル18とから
楕戒される。
FIG. 1 is a block diagram of an embodiment of the present invention, which includes a central processing unit 11, a main storage device 12, an input device l3, and controls reading of the input device 13 according to commands from the central processing unit 11. An input control section 14, an output device 15, an output control section 16 that controls writing to the output device 15 in accordance with commands from the central processing unit 11, and an input control section 14 that converts 1-byte characters to 2-byte characters or 2 The conversion direction setting switch 17 sets whether byte characters are to be converted to 1-byte characters, and the 1-byte 2-byte conversion table 18 has 2-byte characters corresponding to each 1-byte character.

次に、以上の構成における動作について説明を進めると
、中央処理装置11はまず入力制御部14に対して1レ
コードの読込み指示を与える.入力制御部14は1レコ
ードの読込指示を受取ると入力装置13を起動し、入力
装置13から送られてくる読取りデータを順次主記憶装
置12の入力レコードバッファ領域21に転送し、1レ
コードの区切が検出されると、入力装置13の動作を停
止させる。次に中央処理装置11は、入力レコードバッ
ファ領域21に読込まれたデータの先頭1文字分の内容
を変換入力バッファ領域22に転記する。この際、中央
処理装置11は変換方向設定スイッチ17の内容を参照
し、入力レコードバッファ領域21の内容が1バイト系
文字列か2バイト系文字列かを判定して、転記内容を1
バイトか2バイトかに設定する。1バイト系文字であっ
た場合は、それに対応する1つの2バイト系文字が登録
されている1バイト2バイト変換テーブル18を、中央
処理装置11が検索することにより求めるべき2バイト
系文字を得る。次いで中央処理装置11は得られた2バ
イト系文字を変換用出力バッフア領域23へ転記し、さ
らに変換用出力バッファ領域23の内容を出力レコード
バッファ領域24の先頭2バイトへ移送する。以上の入
力レコードバッファ領域21から変換処理を行ない、出
力レコードバッファ領域24へ必要とするデータを格納
する処理は、それぞれの先頭バイトから順次処理がくり
返し行なわれ、入力レコードバッファ領域21の最終デ
ータが終了するまで行なわれる。
Next, to proceed with the explanation of the operation of the above configuration, the central processing unit 11 first gives an instruction to the input control unit 14 to read one record. When the input control unit 14 receives an instruction to read one record, it activates the input device 13, sequentially transfers the read data sent from the input device 13 to the input record buffer area 21 of the main storage device 12, and divides each record. When detected, the operation of the input device 13 is stopped. Next, the central processing unit 11 transfers the contents of the first character of the data read into the input record buffer area 21 to the conversion input buffer area 22. At this time, the central processing unit 11 refers to the content of the conversion direction setting switch 17, determines whether the content of the input record buffer area 21 is a 1-byte character string or a 2-byte character string, and changes the transcription content to 1.
Set to byte or 2 bytes. If it is a 1-byte character, the central processing unit 11 searches the 1-byte 2-byte conversion table 18 in which a corresponding 2-byte character is registered to obtain the 2-byte character to be found. . Next, the central processing unit 11 transfers the obtained double-byte characters to the conversion output buffer area 23, and further transfers the contents of the conversion output buffer area 23 to the first two bytes of the output record buffer area 24. The process of converting from the input record buffer area 21 and storing the required data in the output record buffer area 24 is repeated sequentially starting from the first byte of each byte, and the final data in the input record buffer area 21 is This will continue until the end.

また、変換方向設定スイッチ17の指定を変えておくこ
とで、2バイト系文字列から1バイト系文字列への変換
も同様な処理で実行される。すなわち、変換方向設定ス
イッチl7の設定を変えるだけで、1バイト→2バイト
、2バイト→lバイトの変換方向の切換がなされ、双方
向変換を実現している。
Furthermore, by changing the designation of the conversion direction setting switch 17, conversion from a 2-byte character string to a 1-byte character string can be performed in a similar manner. That is, by simply changing the setting of the conversion direction setting switch 17, the conversion direction can be switched from 1 byte to 2 bytes and from 2 bytes to 1 byte, realizing bidirectional conversion.

次いで中央処理装置1は出力制御部16に対して1レコ
ードの出力指示を与える。出力制御部16は1レコード
の書出し指示を受けると、出力装置15を起動し、出力
レコードバッファ領域21の内容を順次ファイル20へ
転送し、出力レコードバッファ領域24のすべてのデー
タが転送され終ると、出力装置15を停止させる. このようにして、変換前データが格納されているファイ
ル19の1レコード分のデータが変換後データを格納す
るファイル20の1レコード分のデータとして変換処理
される。この1レコードに対する処理は、ファイル19
の最終レコードまで同様にくり返され、入力制御部14
がファイル19のデータエンドを検知することにより終
了する,これによりファイル19のすべての内容を変換
し求めるべきデータを格納したファイル20を得ること
ができる。
Next, the central processing unit 1 gives an instruction to the output control section 16 to output one record. When the output control unit 16 receives an instruction to write one record, it starts the output device 15, sequentially transfers the contents of the output record buffer area 21 to the file 20, and when all the data in the output record buffer area 24 has been transferred. , the output device 15 is stopped. In this way, data for one record of the file 19 storing pre-conversion data is converted into data for one record of the file 20 storing post-conversion data. The processing for this one record is file 19.
The same process is repeated until the final record of
The process ends when the data end of the file 19 is detected. As a result, all the contents of the file 19 can be converted to obtain the file 20 that stores the data to be obtained.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、1バイト2バイト変換テ
ーブルと変換方向設定スイッチを使用した一連の変換処
理により、1バイト系文字列から2バイト系文字列への
変換、更に2バイト系文字列から1バイト系文字列への
変換の双方向変換を容易に実現できる効果がある。
As explained above, the present invention converts a 1-byte character string to a 2-byte character string, and further converts a 2-byte character string into a 2-byte character string by a series of conversion processes using a 1-byte 2-byte conversion table and a conversion direction setting switch. This has the effect of easily realizing bidirectional conversion from to a 1-byte character string.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の構成図、第2図は本発明の一実施例の
ブロック図である。 1・・・入力手段、2・・・変換用入力バッファ登録手
段、3・・・変換方向判断手段、4・・・1バイト2バ
イト変換テーブル検索手段、5・・・出力レコードバッ
ファ登録手段、6・・・出力手段、1l・・・中央処理
装置、12・・・主記憶装置、13・・・入力装置、1
4・・・入力制御部、15・・・出力装置、16・・・
出力制御部、17・・・変換方向設定スイッチ、18・
・・lバイト2バイト変換テーブル、19.20・・・
ファイル、21・・・入力レコードバッファ領域、22
・・・変換用入力バッファ領域、23・・・変換用出力
バッファ領域、24・・・出力レコードバッファ領域。
FIG. 1 is a block diagram of the present invention, and FIG. 2 is a block diagram of an embodiment of the present invention. DESCRIPTION OF SYMBOLS 1... Input means, 2... Conversion input buffer registration means, 3... Conversion direction determination means, 4... 1 byte 2 byte conversion table search means, 5... Output record buffer registration means, 6... Output means, 1l... Central processing unit, 12... Main storage device, 13... Input device, 1
4... Input control unit, 15... Output device, 16...
Output control unit, 17... Conversion direction setting switch, 18.
...l byte 2 byte conversion table, 19.20...
File, 21... Input record buffer area, 22
... Input buffer area for conversion, 23... Output buffer area for conversion, 24... Output record buffer area.

Claims (1)

【特許請求の範囲】[Claims]  1バイトで表現される文字のみで構成されたレコード
あるいは2バイトで表現される文字のみで構成されたレ
コードをレコード単位で入力レコードバッファへ読込む
入力手段と、この入力レコードバッファ中の文字列を先
頭から順次変換用入力バッファへ移送する変換用入力バ
ッファ登録手段と、1バイト系文字列を2バイト系文字
列へ変換するかあるいは2バイト系文字列を1バイト系
文字列へ変換するかを設定されたスイッチにより判断す
る変換方向判断手段と、1バイト系の文字のそれぞれに
対応した2バイト系の文字を有する1バイト2バイト変
換テーブルを検索して前記変換用入力バッファ中の文字
に対応した1バイトまたは2バイトで表現される文字を
選択して変換用出力バッフアへ出力する1バイト2バイ
ト変換テーブル検索手段と、前記変換用出力バッファか
ら変換後の文字を出力レコードバッファへ順次格納する
出力レコードバッファ登録手段と、前記出力レコードバ
ッファから格納された文字列をレコード単位で出力する
出力手段とを有することを特徴とする1バイト2バイト
文字列双方向変換方式。
An input means for reading into an input record buffer record by record a record consisting only of characters expressed in 1 byte or a record consisting only of characters expressed in 2 bytes, and a character string in this input record buffer. Conversion input buffer registration means for sequentially transferring from the beginning to the conversion input buffer, and whether to convert a 1-byte character string to a 2-byte character string or a 2-byte character string to a 1-byte character string. A conversion direction determination means that determines based on a set switch, and a 1-byte 2-byte conversion table having 2-byte characters corresponding to each 1-byte character is searched to correspond to the characters in the conversion input buffer. a 1-byte 2-byte conversion table search means for selecting a character expressed in 1 or 2 bytes and outputting it to a conversion output buffer; and sequentially storing converted characters from the conversion output buffer to an output record buffer. 1. A 1-byte and 2-byte character string bidirectional conversion method, comprising: an output record buffer registration means; and an output means for outputting a character string stored from the output record buffer in units of records.
JP1236542A 1989-09-11 1989-09-11 1-byte/2-byte character string bidirectional conversion system Pending JPH0398113A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1236542A JPH0398113A (en) 1989-09-11 1989-09-11 1-byte/2-byte character string bidirectional conversion system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1236542A JPH0398113A (en) 1989-09-11 1989-09-11 1-byte/2-byte character string bidirectional conversion system

Publications (1)

Publication Number Publication Date
JPH0398113A true JPH0398113A (en) 1991-04-23

Family

ID=17002213

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1236542A Pending JPH0398113A (en) 1989-09-11 1989-09-11 1-byte/2-byte character string bidirectional conversion system

Country Status (1)

Country Link
JP (1) JPH0398113A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012216106A (en) * 2011-04-01 2012-11-08 Seiko Epson Corp Recording controller, recording system, recording control method and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012216106A (en) * 2011-04-01 2012-11-08 Seiko Epson Corp Recording controller, recording system, recording control method and program

Similar Documents

Publication Publication Date Title
JPH0330177B2 (en)
JPH0398113A (en) 1-byte/2-byte character string bidirectional conversion system
JPH02208716A (en) Character and pattern output device
JPS605330A (en) Word processor
JPH02158861A (en) Half size character string conversion system
JPH0365588B2 (en)
JP2634926B2 (en) Kana-Kanji conversion device
US5404517A (en) Apparatus for assigning order for sequential display of randomly stored titles by comparing each of the titles and generating value indicating order based on the comparison
JP3342026B2 (en) Kana-Kanji conversion device
JP3350070B2 (en) Kana-Kanji conversion device
JP2629946B2 (en) Document processing device
JPS5922134A (en) Printer device
JP3273607B2 (en) Document processing device
JPH03225448A (en) Converting, outputting, and updating method for information in file
JPH02280289A (en) Document reader and processor
JPH03197064A (en) Dot printer
JP2000181666A (en) Method for expanding image
JPS60129888A (en) Document editing device
JPH03266665A (en) Controlling method for character attribute in printing device
JPH0797371B2 (en) Character data storage
JPH04161365A (en) Printer
JPS5882763A (en) Print controller
JPH0796639A (en) Printer
JPH0573539A (en) Kana/kanji conversion device
JPH01116885A (en) Picture processor