JP2643330B2 - Conversion method of internal representation format of character string - Google Patents

Conversion method of internal representation format of character string

Info

Publication number
JP2643330B2
JP2643330B2 JP63183139A JP18313988A JP2643330B2 JP 2643330 B2 JP2643330 B2 JP 2643330B2 JP 63183139 A JP63183139 A JP 63183139A JP 18313988 A JP18313988 A JP 18313988A JP 2643330 B2 JP2643330 B2 JP 2643330B2
Authority
JP
Japan
Prior art keywords
character
character string
byte
internal representation
code length
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.)
Expired - Fee Related
Application number
JP63183139A
Other languages
Japanese (ja)
Other versions
JPH0233222A (en
Inventor
政富 稲垣
峰明 横山
徹 荒谷
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP63183139A priority Critical patent/JP2643330B2/en
Publication of JPH0233222A publication Critical patent/JPH0233222A/en
Application granted granted Critical
Publication of JP2643330B2 publication Critical patent/JP2643330B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Input From Keyboards Or The Like (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は計算機システムにおける文字列の内部表現
形式変換方法に関する。
Description: TECHNICAL FIELD The present invention relates to a method for converting a character string into an internal representation in a computer system.

〔従来の技術〕[Conventional technology]

従来、英数字等の1文字あたり1バイトの記憶領域を
必要とする文字のみからなる1バイト文字列と、漢字等
の1文字あたり2バイトの記憶領域を必要とする文字を
含むことが可能な2バイト文字列の2種類の文字列内部
表現形式を持つ計算機システムにおいては、プログラム
を入力する際、プログラマは文字列の生成時に1バイト
又は2バイトのどちらの内部表現形式を用いるかを明示
的に指定していた。
Conventionally, it is possible to include a one-byte character string composed of only characters requiring one-byte storage area per character such as alphanumeric characters, and a character requiring two-byte storage area per character such as kanji. In a computer system having two types of character string internal representations of a two-byte character string, when inputting a program, the programmer explicitly specifies whether to use a one-byte or two-byte internal representation when generating a character string. Was specified.

すなわち、現在知られている各種コンパイラ及びイン
タープリタには、少なくとも1バイト長及び2バイト長
のデータ型が存在し、プログラム内で文字列を使用する
場合には該文字列のデータ型を宣言する必要があるた
め、プログラマがプログラミングする際には、英数字等
の1バイト文字のみからなる文字列については、1バイ
トのデータ型で宣言した配列に該文字列を格納し、漢字
等の2バイト文字からなる文字列については2バイトの
データ型で宣言した配列に該文字列を格納しなければな
らない。
That is, currently known various compilers and interpreters have data types of at least 1-byte length and 2-byte length, and when a character string is used in a program, it is necessary to declare the data type of the character string. Therefore, when programming by a programmer, for a character string consisting of only single-byte characters such as alphanumeric characters, store the character string in an array declared with a 1-byte data type, and use 2-byte characters such as kanji Must be stored in an array declared with a 2-byte data type.

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

このため、プログラムは常に文字列の内部表現形式を
意識しながらプログラムを作成しなければならず、ま
た、ある内部表現形式を持つ文字列に対して、他の内部
表現形式を持つ文字列を挿入したり、一部の文字の内部
表現形式を他の内部表現形式に置換する処理を含むプロ
グラムを作成する場合にも、常に文字列の内部表現形式
を意識する必要がある。
For this reason, programs must always be aware of the internal representation of character strings when writing programs, and insert a character string with another internal representation into a character string with one internal representation. It is necessary to always be aware of the internal representation of a character string when creating a program that includes processing for replacing the internal representation of some characters with another internal representation.

このように、文字列の内部表現形式という一種の足枷
により、プログラマによるプログラムの作成作業が複雑
化し、プログラミング効率が低下し、場合によっては誤
入力をもたらすという問題があった。
As described above, the kind of shackles of the internal representation format of the character string complicates the program creation work by the programmer, reduces the programming efficiency, and in some cases, causes erroneous input.

そこで、この発明では、上記従来技術の問題を解決
し、プログラマがプログラミングを行う際に、異なる内
部表現形式を持つ文字列が存在する場合であっても各文
字列の内部表現形式を意識することなくプログラムを記
述できるようにし、もってプログラマによるプログラミ
ングを容易にすることを目的とする。
In view of the above, the present invention solves the above-mentioned problem of the prior art, and allows a programmer to be aware of the internal representation form of each character string when programming, even when character strings having different internal representation forms exist. It is an object of the present invention to make it possible to describe a program without programming, thereby facilitating programming by a programmer.

〔課題を解決するための手段〕[Means for solving the problem]

上記課題を解決するため、本発明は、Xバイトの文字
コード長で各文字を内部表現したXバイト文字列と、該
Xバイトよりも長いYバイトの文字コード長で各文字を
内部表現したYバイト文字列とを処理対象とし、前記X
バイト文字列とYバイト文字列とで異なる処理を行う計
算機システムの内部表現形式変換方法であって、Xバイ
トの文字コード長で内部表現された文字の文字列の処理
においてYバイトの文字コードで内部表現された文字を
検出すると、前記Xバイトの文字コード長で表現された
文字列をYバイトの文字コード長の内部表現形式に変換
することを特徴とする。
In order to solve the above problem, the present invention provides an X-byte character string in which each character is internally represented by a character code length of X bytes, and a Y-character in which each character is internally represented by a character code length of Y bytes longer than the X bytes. A byte character string and the X
An internal representation format conversion method for a computer system that performs different processing between a byte character string and a Y byte character string, wherein a Y character code is used to process a character string internally represented by an X byte character code length. When an internally represented character is detected, the character string represented by the X-byte character code length is converted into an Y-byte character code length internal representation format.

また、本発明は、Xバイトの文字コード長で各文字を
内部表現したXバイト文字列と、該Xバイトよりも長い
Yバイトの文字コード長で各文字を内部表現したYバイ
ト文字列とを処理対象とし、前記Xバイト文字列とYバ
イト文字列とで異なる処理を行う計算機システムの内部
表現形式変換方法であって、Xバイトの文字コード長で
内部表現された第1の文字列の所定の位置にYバイトの
文字コード長で内部表現される第2の文字列が挿入され
た文字列からなるプログラムを受け付け、文字列の内部
表面の異なる文字を検出すると、該プログラムで定義さ
れた第1の文字列の各文字要素の内部表現形式をYバイ
トの文字コード長を有するYバイト文字にそれぞれ変換
した後、変換後の第1の文字列に前記第2の文字列を挿
入して第3の文字列を生成し、生成した第3の文字列に
対してYバイト文字列に対応する処理を行うことを特徴
とする。
Further, the present invention provides an X-byte character string that internally represents each character with a character code length of X bytes and a Y-byte character string that internally represents each character with a character code length of Y bytes longer than the X bytes. An internal representation format conversion method for a computer system that performs a different process between the X-byte character string and the Y-byte character string as a processing target, the method comprising: determining a first character string internally represented by an X-byte character code length Accepts a program consisting of a character string in which a second character string internally represented by a character code length of Y bytes is inserted at the position of, and when a different character on the inner surface of the character string is detected, After converting the internal representation of each character element of the first character string into Y-byte characters having a Y-byte character code length, inserting the second character string into the converted first character string, String of 3 Generated, and performs a process corresponding to the Y byte string for the generated third string.

〔作用〕[Action]

入力されたプログラムの文字データは、プログラムの
実行時にその内部表現形式が処理内容に応じて変換され
るので、プログラマはデータの入力時に文字の内部表現
形式を意識することなく同様の操作で文字列を取り扱う
ことができる。
When the character data of the input program is executed, the internal representation is converted according to the processing content when the program is executed, so the programmer can perform the same operation without having to be aware of the internal representation of the character when inputting the data. Can be handled.

〔実施例〕〔Example〕

以下、この発明の実施例を図面と共に説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.

第2図はこの発明に係る文字列の内部表現形式変換方
法を実施するための計算機システムを示す構成ブロック
図である。この計算機システムは、データやコマンドの
入力手段であるキーボード1と、このキーボード1から
入力されたデータ等を表示する出力手段であるディスプ
レイ装置2と、後述する処理手順のフローチャートに基
づいたプログラムのほか、各種処理を実行するための制
御プログラムが格納されたメモリ3と、前記キーボード
1から入力されたデータ等を記憶する入力バッファ4
と、前記メモリ3に格納されたプログラムに基づいて、
キーボード1から入力されたデータの各種処理を行なう
と共に、上記各部の制御を行なうCPU5とから構成され、
英数字等の1文字あたり1バイトの記憶領域を必要とす
る文字のみからなる1バイト文字列と、漢字等の1文字
あたり2バイトの記憶領域を必要とする文字を含むこと
が可能な2バイト文字列の2種類の2文字列内部表現形
式を持っている。
FIG. 2 is a block diagram showing the configuration of a computer system for implementing the method of converting a character string into an internal representation according to the present invention. The computer system includes a keyboard 1 as input means for data and commands, a display device 2 as output means for displaying data and the like input from the keyboard 1, and a program based on a flowchart of a processing procedure described later. , A memory 3 storing a control program for executing various processes, and an input buffer 4 storing data input from the keyboard 1 and the like.
And based on the program stored in the memory 3,
A CPU 5 that performs various processes on data input from the keyboard 1 and controls the above-described units;
A 1-byte character string consisting of only characters that require a 1-byte storage area per character, such as alphanumeric characters, and 2 bytes that can contain characters that require a 2-byte storage area per character, such as kanji It has two types of character string internal representation format.

次に、上記計算機システムにおいて、ある文字列に内
部表現形式が異なる文字を挿入する処理を含むプログラ
ムを実行する場合の一例を第1図を用いて説明する。
Next, an example of executing a program including a process of inserting a character having a different internal representation into a certain character string in the computer system will be described with reference to FIG.

第1図は、1バイト長の内部表現を持つ文字からなる
文字列に対して2バイト長の文字を挿入する処理を含む
プログラムを処理する際の処理手順を示すものである。
図において、1バイト文字列の内部表現(S1)を持つ文
字列S「abcd」に対して、2バイト文字(c)「亜」を
挿入する場合、まず、文字列Sの内部表現を2バイト文
字列の内部表現(S2)「abcd」に動的に変換する。そし
て、2バイト文字列となった文字列Sに文字(c)
「亜」を挿入することにより、2バイト文字列の内部表
現(S2′)による文字列S「ab亜cd」を得ることができ
る。
FIG. 1 shows a processing procedure for processing a program including a process of inserting a 2-byte character into a character string composed of a character having a 1-byte internal representation.
In the figure, when inserting a two-byte character (c) “a” into a character string S “abcd” having a one-byte character string internal representation (S 1 ), first, the internal representation of the character string S is set to 2 internal representation of the byte string (S 2) to dynamically converted to "abcd". Then, the character (c) is added to the character string S that has become a two-byte character string.
By inserting "sub", it is possible to obtain the string S to "ab sub cd" by internal representation of the 2-byte character string (S 2 ').

このように、プログラマは、プログラムを作成する際
に、文字列S1が1バイト文字列で、文字Cが2バイト文
字であることを意識することなくプログラミングを行
い、計算機システム側が、この内部表現形式の違いを吸
収するため、プログラマによるプログラミングが容易に
なる。
As described above, when creating a program, the programmer performs programming without being aware that the character string S1 is a one-byte character string and the character C is a two-byte character. The difference can be absorbed, so that the programmer can easily program.

次に、第2図のCPU5による文字列の内部表現形式変換
の処理手順を第3図のフローチャートを用いて説明す
る。
Next, the processing procedure of the internal representation format conversion of the character string by the CPU 5 of FIG. 2 will be described with reference to the flowchart of FIG.

第3図において、CPU5はまず文字列Sが1バイト文字
列かどうか判断する(ステップ101)。ここで文字列S
が1バイト文字列でないときは、文字Cをそのまま挿入
する(ステップ104)。一方、ステップ101でSが1バイ
ト文字列であるときはステップ102に移り、文字Cが2
バイト文字でなければステップ104に移行して文字Cを
挿入する。また、ステップ102で文字Cが2バイト文字
であるときには、文字列Sの内部表現形式を2バイト文
字列に動的に変換し(ステップ103)、文字Cを挿入す
る(ステップ104)。
In FIG. 3, the CPU 5 first determines whether or not the character string S is a one-byte character string (step 101). Where the string S
Is not a one-byte character string, the character C is inserted as it is (step 104). On the other hand, if S is a one-byte character string in step 101, the process proceeds to step 102, where
If it is not a byte character, the process proceeds to step 104 to insert the character C. If the character C is a two-byte character in step 102, the internal representation of the character string S is dynamically converted to a two-byte character string (step 103), and the character C is inserted (step 104).

上記実施例では、1バイト文字列に対して2バイト文
字を挿入する場合を例にして説明したが、この発明はこ
れに限定されるものではなく、文字列の生成時や文字又
は文字列の削除、変換等の走査を行う場合でも適用する
ことができる。また、あらかじめデフォルトの内部表現
形式を指定しておけば、文字列の生成時の内部表現形式
を所定のバイト文字列に選択することができる。さら
に、既存の1バイト文字列によるプログラムに対して
も、異なる内部表現形式を持つ文字列の挿入を簡単に行
なうことができ、2バイト又は3バイトの文字列を変更
を加えることなくそのまま適用することができる。
In the above-described embodiment, an example has been described in which a 2-byte character is inserted into a 1-byte character string. However, the present invention is not limited to this. The present invention can be applied even when scanning such as deletion and conversion is performed. If a default internal representation format is specified in advance, the internal representation format at the time of generating the character string can be selected as a predetermined byte character string. Furthermore, a character string having a different internal representation format can be easily inserted into an existing one-byte character string program, and a two-byte or three-byte character string can be applied without modification. be able to.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明では、Xバイトの文字コ
ード長で内部表現された文字の文字列の処理においてY
バイトの文字コードで内部表現された文字を検出する
と、前記Xバイトの文字コード長で表現された文字列を
Yバイトの文字コード長の内部表現形式に変換するよう
構成したので、プログラマは文字列の内部表現形式を意
識することなくプログラミングを容易に行うことがで
き、もってプログラミング効率の向上を図ることができ
る。
As described above, according to the present invention, in processing a character string internally represented by a character code length of X bytes, Y
When the character internally represented by the byte character code is detected, the character string represented by the X-byte character code length is converted to the internal representation form of the Y-byte character code length. The programming can be easily performed without being aware of the internal expression form of the program, and the programming efficiency can be improved.

また、本発明では、Xバイトの文字コード長で内部表
現された第1の文字列の所定の位置にYバイトの文字コ
ード長で内部表現される第2の文字列が挿入された文字
列からなるプログラムを受け付け、文字列の内部表現の
異なる文字を検出すると、該プログラムで定義された第
1の文字列の各文字要素の内部表現形式をYバイトの文
字コード長を有するYバイト文字にそれぞれ変換した
後、変換後の第1の文字列に第2の文字列を挿入して第
3の文字列を生成し、生成した第3の文字列に対してY
バイト文字列に対応する処理を行うよう構成したので、
プログラム内に内部表現形式が異なる文字列を結合する
場合であっても、プログラマは、各文字列の内部表現形
式を意識することなくプログラミングを行うことができ
る。
Further, in the present invention, a character string in which a second character string internally represented by a Y-byte character code length is inserted at a predetermined position of a first character string internally represented by an X-byte character code length When a program having a different internal representation of a character string is detected, the internal representation form of each character element of the first character string defined by the program is converted to a Y-byte character having a Y-byte character code length. After the conversion, the second character string is inserted into the converted first character string to generate a third character string, and the generated third character string is subjected to Y
Since it is configured to perform processing corresponding to byte strings,
Even in the case where character strings having different internal representations are combined in a program, the programmer can perform programming without being aware of the internal representation of each character string.

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

第1図はこの発明の一実施例を示す説明図、第2図はこ
の発明を実施するための計算機システムを示す構成ブロ
ック図、第3図はCPUの処理手順を示すフローチャート
である。 1……キーボード、2……ディスプレイ装置、3……メ
モリ、4……入力バッファ、5……CPU。
FIG. 1 is an explanatory diagram showing an embodiment of the present invention, FIG. 2 is a block diagram showing a configuration of a computer system for carrying out the present invention, and FIG. 3 is a flowchart showing a processing procedure of a CPU. 1 ... keyboard, 2 ... display device, 3 ... memory, 4 ... input buffer, 5 ... CPU.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 荒谷 徹 東京都渋谷区代々木3丁目57番6号 グ ランフォーレ 富士ゼロックス株式会社 内 (56)参考文献 特開 昭61−163424(JP,A) 特開 昭63−88626(JP,A) ──────────────────────────────────────────────────続 き Continuation of the front page (72) Inventor Toru Araya 3-57-6 Yoyogi, Shibuya-ku, Tokyo Granforet Fuji Xerox Co., Ltd. (56) References JP-A-61-163424 (JP, A) Kaisho 63-88626 (JP, A)

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】Xバイトの文字コード長で各文字を内部表
現したXバイト文字列と、該Xバイトよりも長いYバイ
トの文字コード長で各文字を内部表現したYバイト文字
列とを処理対象とし、前記Xバイト文字列とYバイト文
字列とで異なる処理を行う計算機システムの内部表現形
式変換方法であって、 Xバイトの文字コード長で内部表現された文字の文字列
の処理においてYバイトの文字コードで内部表現された
文字を検出すると、前記Xバイトの文字コード長で表現
された文字列をYバイトの文字コード長の内部表現形式
に変換する ことを特徴とする計算機システムの内部表現形式変換方
法。
An X-byte character string internally representing each character with a character code length of X bytes and a Y-byte character string internally representing each character with a character code length of Y bytes longer than the X bytes are processed. An internal representation format conversion method for a computer system that performs different processing between the X-byte character string and the Y-byte character string, wherein Y is used for processing a character string internally represented by an X-byte character code length. Detecting a character internally represented by a byte character code, converting the character string represented by the X-byte character code length into an internal representation form of a Y-byte character code length; Expression format conversion method.
【請求項2】Xバイトの文字コード長で各文字を内部表
現したXバイト文字列と、該Xバイトよりも長いYバイ
トの文字コード長で各文字を内部表現したYバイト文字
列とを処理対象とし、前記Xバイト文字列とYバイト文
字列とで異なる処理を行う計算機システムの内部表現形
式変換方法であって、 Xバイトの文字コード長で内部表現された第1の文字列
の所定の位置にYバイトの文字コード長で内部表現され
る第2の文字列が挿入された文字列からなるプログラム
を受け付け、 文字列の内部表面の異なる文字を検出すると、該プログ
ラムで定義された第1の文字列の各文字要素の内部表現
形式をYバイトの文字コード長を有するYバイト文字に
それぞれ変換した後、変換後の第1の文字列に前記第2
の文字列を挿入して第3の文字列を生成し、 生成した第3の文字列に対してYバイト文字列に対応す
る処理を行う ことを特徴とする計算機システムの内部表現形式変換方
法。
2. An X-byte character string internally representing each character with a character code length of X bytes and a Y-byte character string internally representing each character with a character code length of Y bytes longer than the X bytes A method for converting an internal representation format of a computer system, which performs a different process between the X-byte character string and the Y-byte character string, wherein a predetermined character string of a first character string internally represented by a character code length of X bytes When a program including a character string in which a second character string internally represented by a character code length of Y bytes is inserted at a position and a different character on the inner surface of the character string is detected, a first character defined by the program is detected. After converting the internal representation form of each character element of the character string into a Y-byte character having a character code length of Y bytes,
And generating a third character string by inserting the third character string, and performing a process corresponding to the Y-byte character string on the generated third character string.
JP63183139A 1988-07-22 1988-07-22 Conversion method of internal representation format of character string Expired - Fee Related JP2643330B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63183139A JP2643330B2 (en) 1988-07-22 1988-07-22 Conversion method of internal representation format of character string

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63183139A JP2643330B2 (en) 1988-07-22 1988-07-22 Conversion method of internal representation format of character string

Publications (2)

Publication Number Publication Date
JPH0233222A JPH0233222A (en) 1990-02-02
JP2643330B2 true JP2643330B2 (en) 1997-08-20

Family

ID=16130483

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63183139A Expired - Fee Related JP2643330B2 (en) 1988-07-22 1988-07-22 Conversion method of internal representation format of character string

Country Status (1)

Country Link
JP (1) JP2643330B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61163424A (en) * 1985-01-14 1986-07-24 Nec Corp Keyboard
JPS6388626A (en) * 1986-10-01 1988-04-19 Hitachi Ltd Document processing system

Also Published As

Publication number Publication date
JPH0233222A (en) 1990-02-02

Similar Documents

Publication Publication Date Title
US5740405A (en) Method and system for providing data compatibility between different versions of a software program
AU630360B2 (en) Intermediate spreadsheet structure
EP0805406B1 (en) Method and apparatus for automatic generation of documents with single-layered backgrounds from documents with multi-layered backgrounds
JP2643330B2 (en) Conversion method of internal representation format of character string
US5842164A (en) Dynamic pattern recognition system
JP2620545B2 (en) Editing device driven by table
JP2651138B2 (en) Document processing device
JP3543986B2 (en) Character processing method and apparatus
JP2591021B2 (en) Character pattern generation method
JP2746666B2 (en) Document connection print processing method
JP3348480B2 (en) Graphic output device
JPS6367215B2 (en)
JP3237709B2 (en) Document processing apparatus and document processing method
JPH0572270B2 (en)
JPH0528156A (en) Document data converter
JP2761564B2 (en) Data processing device
JPH096764A (en) Document processor
JP3023850B2 (en) Graph data creation device with dynamic appearance information processing mechanism
JPS61253577A (en) Japanese word processing filter
JPH0543134B2 (en)
JPS62156769A (en) Display system for corrected area
JPH04190450A (en) Document processor
JPH0561616A (en) Printer control system
JPH07200562A (en) Document format setting method
JPH03186933A (en) Symbol processing system for language processing system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees