JP2005293440A - Character code conversion method, computer with character code conversion function and character code conversion program - Google Patents

Character code conversion method, computer with character code conversion function and character code conversion program Download PDF

Info

Publication number
JP2005293440A
JP2005293440A JP2004110704A JP2004110704A JP2005293440A JP 2005293440 A JP2005293440 A JP 2005293440A JP 2004110704 A JP2004110704 A JP 2004110704A JP 2004110704 A JP2004110704 A JP 2004110704A JP 2005293440 A JP2005293440 A JP 2005293440A
Authority
JP
Japan
Prior art keywords
character code
data
computer
character
describing
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
JP2004110704A
Other languages
Japanese (ja)
Inventor
Takafumi Ogata
孝文 緒方
Kazuyoshi Shinpo
和義 新保
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
NEC Communication Systems Ltd
Original Assignee
NEC Corp
NEC Communication Systems 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 NEC Corp, NEC Communication Systems Ltd filed Critical NEC Corp
Priority to JP2004110704A priority Critical patent/JP2005293440A/en
Publication of JP2005293440A publication Critical patent/JP2005293440A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

【課題】 オペレーションステムやコンピュータ識別コード等を指定しなくても適切な文字コード変換を実行することのできる文字コード変換方法を提供する。
【解決手段】 読み込みの対象となるデータの文字コードとして想定される文字コードの特徴を文字コード表1,2,3,・・・,nとして予めコンピュータ1に記憶させておく。読み込みの対象となるファイル7のデータを記述している文字コードの特徴と文字コード表1,2,3,・・・,nの特徴を、文字コードに対応する文字の定義の有無に基いてコンピュータ1で比較し、ファイル7を記述している文字コード表jを特定する。文字コード表jとコンピュータ1が使用する文字コード表1との組み合わせに適合したルールを適用してファイル7に公知の文字コード変換を施し、変換後のファイル7’をコンピュータ1上で動作するプログラムに読み込ませる。
【選択図】図1
PROBLEM TO BE SOLVED: To provide a character code conversion method capable of executing appropriate character code conversion without specifying an operation system or a computer identification code.
Characteristic of a character code assumed as a character code of data to be read is previously stored in a computer 1 as character code tables 1, 2, 3,..., N. The characteristics of the character code describing the data of the file 7 to be read and the characteristics of the character code tables 1, 2, 3,..., N are based on the presence or absence of the definition of the character corresponding to the character code. The computer 1 compares and specifies the character code table j describing the file 7. A program for applying a known character code conversion to the file 7 by applying a rule adapted to the combination of the character code table j and the character code table 1 used by the computer 1, and operating the converted file 7 'on the computer 1 To load.
[Selection] Figure 1

Description

本発明は、ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前にデータを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換方法および文字コード変換機能付コンピュータと文字コード変換用プログラムに関する。   The present invention provides a character code conversion method and a character code conversion function for adapting a character code describing data to a computer operating system before the data described in the file is read by a program operating on the computer. The present invention relates to a computer and a character code conversion program.

ファイルを使ってプログラムにデータを入力する場合、そこで使用されるファイルは、実際にプログラムが動作するオペレーティングシステムとは別のオペレーティングシステム上の汎用ソフトウェア、例えば、エディタ等で作成されることが多い。
また、一般的に、文字コードはオペレーティングシステム毎に異なる。よって、プログラムにデータを入力する際には、実際にプログラムが動作するオペレーティングシステムに合わせ、予め、文字コードを変換したファイルを用意しておく必要があって煩わしい。
When data is input to a program using a file, the file used there is often created by general-purpose software on an operating system different from the operating system on which the program actually operates, such as an editor.
In general, the character code is different for each operating system. Therefore, when inputting data into the program, it is necessary to prepare a file in which character codes have been converted in advance according to the operating system on which the program actually operates.

文字コードの相違によって生じる不都合を改善するための技術としては、例えば、特許文献1に開示されるような文字データ変換転送方式、あるいは、特許文献2に開示されるような文字コード自動変換装置が公知である。   As a technique for improving the inconvenience caused by the difference in the character code, for example, there is a character data conversion / transfer system as disclosed in Patent Document 1 or an automatic character code conversion apparatus as disclosed in Patent Document 2. It is known.

特許文献1に開示された文字データ変換転送方式は、オペレーティングシステムの異なるコンピュータ間でのデータの受け渡しに際し、データの転送元で転送先のオペレーティングシステムに合わせてデータの文字コードを変換するものであり、文字コードの変換処理が自動化される点では便利であるが、文字コードの変換処理は、必ず、データの転送元で実行する必要がある。
従って、既に何らかの文字コードで記述されたデータがコンピュータの内部または外部に存在したとしても、データを記述している文字コードが当該コンピュータのオペレーティングシステムの文字コードと相違すれば、このデータを当該コンピュータ上で動作するプログラムに読み込ませることはできない。
つまり、コンピュータ上で動作するプログラムにデータを入力する際には、実際にプログラムが動作するコンピュータとは異なる別のコンピュータを利用して予め文字コード変換済みのファイルを準備しておかなければならず、最低限、コンピュータが2台は必要となる欠点がある。
The character data conversion and transfer method disclosed in Patent Document 1 converts the character code of data at the data transfer source in accordance with the transfer destination operating system when data is transferred between computers having different operating systems. Although it is convenient in that the character code conversion process is automated, the character code conversion process must be executed at the data transfer source.
Therefore, even if data already described in some character code exists inside or outside the computer, if the character code describing the data is different from the character code of the operating system of the computer, the data is stored in the computer. It cannot be loaded into the program that runs above.
In other words, when data is input to a program that runs on a computer, a file that has been converted into a character code must be prepared in advance using a different computer from the computer that actually runs the program. However, there is a disadvantage that at least two computers are required.

特許文献2に開示された文字コード自動変換装置も、取り扱う文字コードの異なる2以上のコンピュータ間でデータの整合性を得るための文字コード変換を行うといった技術思想に関しては特許文献1のものと同様であり、従って、前記と同様の不都合がある。   The automatic character code conversion device disclosed in Patent Document 2 is also the same as that of Patent Document 1 regarding the technical idea of performing character code conversion to obtain data consistency between two or more computers having different character codes. Therefore, there are the same disadvantages as described above.

また、何れのものも、オペレーションステムの名称やコンピュータ識別コード等を利用者自身が指定することで変換元や変換先の文字コードを特定する構成であるため、コンピュータの操作ミスにより適切な文字コード変換が行えなくなる欠点がある。   In addition, since all of these are configured to specify the character code of the conversion source or conversion destination by the user himself / herself specifying the name of the operation system, the computer identification code, etc., an appropriate character code due to a computer operation error There is a drawback that conversion cannot be performed.

特開平4−361323号公報JP-A-4-361323 特開平5−341956号公報Japanese Patent Laid-Open No. 5-341596

そこで、本発明の課題は、前記従来技術の不都合を改善し、既に何らかの文字コードで記述されたデータがコンピュータの内部または外部に存在した場合に、単一のコンピュータにより、このデータを記述している文字コードをコンピュータのオペレーティングシステムに適合させることができ、また、オペレーションステムの名称やコンピュータ識別コード等を利用者がわざわざ指定しなくても適切な文字コード変換を実行することのできる文字コード変換方法および文字コード変換機能付コンピュータと文字コード変換用プログラムを提供することにある。   Accordingly, an object of the present invention is to improve the inconvenience of the prior art, and when data already described in some character code exists inside or outside the computer, the data is described by a single computer. Character code conversion that can be adapted to the operating system of the computer, and can perform appropriate character code conversion even if the user does not bother to specify the name of the operation system, the computer identification code, etc. A method, a computer with a character code conversion function, and a program for character code conversion are provided.

本発明の文字コード変換方法は、ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前に前記データを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換方法であり、前記課題を解決するため、特に、
読み込みの対象となるデータの文字コードとして想定される文字コードの特徴を予め前記コンピュータに記憶させておき、
前記データを前記プログラムに読み込ませるための前処理として、前記データを記述している文字コードの特徴と予め前記コンピュータに記憶されている何種類かの文字コードの特徴とを比較して前記データを記述している文字コードを特定し、
前記特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データに対して文字コード変換を行い、
文字コード変換によって生成された新たなファイルをプログラム実行用のデータ記述ファイルとして保持することを特徴とした構成を有する。
The character code conversion method of the present invention is a character code conversion method for adapting a character code describing the data to a computer operating system before the data described in the file is read by a program operating on the computer. In order to solve the above problem, in particular,
Characteristic of the character code assumed as the character code of the data to be read is stored in the computer in advance,
As preprocessing for causing the program to read the data, the characteristics of the character code describing the data are compared with the characteristics of several types of character codes stored in the computer in advance. Identify the character code you are describing,
Performing character code conversion on the data so that the data described in the specified character code is described in a character code used in an operating system of the computer;
A new file generated by character code conversion is held as a data description file for program execution.

以上の構成により、ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませるための前処理として、まず、データを記述している文字コードの特徴と予めコンピュータに記憶されている何種類かの文字コードの特徴とを比較し、データを記述している文字コードを特定する。
この際、オペレーションステムの名称やコンピュータ識別コード等を指定してデータを記述している文字コードやコンピュータのオペレーティングシステムで使用されている文字コードを明示する必要はなく、データを記述している文字コードの特徴と予めコンピュータに記憶されている何種類かの文字コードの特徴とを直接的に比較することでデータを記述している文字コードが特定されるので、利用者側におけるコンピュータの操作ミス等によって文字コードの指定を誤るといった問題が解消される。
このようにして、データを記述している文字コードが特定された後、特定された文字コードで記述されているデータがコンピュータのオペレーティングシステムで使用されている文字コードで記述されるようにデータに対する文字コード変換が行われて新たなファイルが生成され、このファイルがプログラム実行用のデータ記述ファイルとして保持される。
従って、データ記述ファイルをコンピュータ上で動作するプログラムに読み込ませることで、当該プログラムに固有の処理操作を的確に実行させることができる。
また、データに対する文字コード変換はプログラムが動作するコンピュータ上で実行されるので、文字コード変換のために別途コンピュータを準備する必要はなく、何らかの文字コードで記述されたデータが既に存在すれば、このデータを其のまま使用してプログラムを実行させることができる。
With the above configuration, as preprocessing for reading data described in a file into a program operating on the computer, first, the characteristics of the character code describing the data and several types stored in advance in the computer The character code describing the data is specified by comparing with the character code characteristics.
At this time, it is not necessary to specify the character code describing the data by specifying the name of the operation system, the computer identification code, etc., or the character code used in the computer operating system. Since the character code describing the data is identified by directly comparing the characteristics of the code with the characteristics of several types of character codes stored in the computer in advance, the user side may make a mistake in operating the computer. This eliminates the problem of erroneously specifying the character code.
In this way, after the character code describing the data is specified, the data described in the specified character code is described in the character code used in the computer operating system. Character code conversion is performed to generate a new file, and this file is held as a data description file for program execution.
Therefore, by reading the data description file into a program operating on the computer, it is possible to accurately execute processing operations unique to the program.
In addition, since character code conversion for data is executed on a computer on which the program operates, it is not necessary to prepare a separate computer for character code conversion. If data written in some character code already exists, The program can be executed using the data as it is.

更に、文字コード変換の際に生成された不要な文字列を削除してプログラム実行用のデータ記述ファイルとして保持するようにしてもよい。   Furthermore, an unnecessary character string generated at the time of character code conversion may be deleted and held as a data description file for program execution.

プログラムの実行前に予め不用な文字列を削除しておくことにより、プログラムの誤動作やプログラムの実行に伴う異常の発生を未然に防止することができる。   By deleting unnecessary character strings in advance before the execution of the program, it is possible to prevent the malfunction of the program and the occurrence of an abnormality accompanying the execution of the program.

この際、不要な文字列として、少なくとも、連続するスペースを削除することが望ましい。   At this time, it is desirable to delete at least continuous spaces as unnecessary character strings.

データを記述している文字コードが適切に特定された場合であっても、例えば、キャリッジリターン(CR)やラインフィード(LF)等のように適切な置き換えが難しい文字制御コードがあり、意味のないスペースが連続的に生成される場合がある。連続するスペースを削除することで、置き換えが困難な文字制御コードに起因する異常を軽減することができる。   Even when the character code describing the data is properly identified, there are character control codes that are difficult to replace properly, such as carriage return (CR) and line feed (LF). There are cases where no spaces are continuously generated. By deleting consecutive spaces, abnormalities caused by character control codes that are difficult to replace can be reduced.

また、読み込みの対象となるデータの文字コードとして想定される文字コードの特徴としては、文字コード表を記憶させておくことが望ましい。   Further, as a characteristic of the character code assumed as the character code of the data to be read, it is desirable to store a character code table.

文字コードの相違は本質的には文字コード表の相違であるから、データを記述している文字コードの特徴と何種類かの文字コード表の特徴とを比較すれば、データを記述している文字コードを特定することが可能である。   Character code differences are essentially character code table differences, so if you compare the characteristics of the character code describing the data with the characteristics of several types of character code tables, the data is described. It is possible to specify the character code.

具体的には、データを記述している文字コードの幾つかを抽出し、この文字コードに対応する文字が文字コード表に定義されている場合に、データを記述している文字コードが当該文字コード表の文字コードであると特定することができる。   Specifically, if some of the character codes describing the data are extracted and the characters corresponding to the character codes are defined in the character code table, the character code describing the data is It can be identified as a character code in the code table.

例えば、データを記述している文字コードを先頭から幾つか抽出し、その文字コードに対応する文字が全て文字コード表に定義されている場合、つまり、データを記述している文字コードが文字コード表の未定義箇所を指定していない場合に、データ記述用の文字コードが当該文字コード表の文字コードであると特定することが可能である。   For example, if some character codes describing data are extracted from the beginning and all the characters corresponding to the character codes are defined in the character code table, that is, the character code describing the data is the character code. When the undefined portion of the table is not designated, it is possible to specify that the character code for data description is the character code of the character code table.

また、本発明の文字コード変換機能付コンピュータは、前記と同様の課題を達成するため、
データを記述している文字コードの特徴と予めコンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段と、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段とを備えたことを特徴とする構成を有する。
The computer with a character code conversion function of the present invention achieves the same problem as described above,
Character code analyzing means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance,
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer; It has the structure characterized by comprising.

以上の構成において、文字コード解析手段が、データを記述している文字コードの特徴と予めコンピュータに記憶されている文字コードの特徴とを比較し、データを記述している文字コードを特定する。
具体的には、文字コード解析手段が、データを記述している文字コードの幾つかを抽出し、その文字コードに対応する文字が何れの文字コード表で定義されているかを判定し、抽出された文字コードの全てが定義された文字コード表に対応する文字コードをデータの記述に用いられた文字コードとして特定することが可能である。
文字コード変換手段は、文字コード解析手段で特定された文字コードで記述されているデータがコンピュータのオペレーティングシステムで使用されている文字コードで記述されるようにデータの文字コードを変換する。
In the above configuration, the character code analysis means compares the character code characteristics describing the data with the character code characteristics stored in advance in the computer, and identifies the character code describing the data.
Specifically, the character code analysis means extracts some of the character codes describing the data, determines in which character code table the character corresponding to the character code is defined, and is extracted. It is possible to specify the character code corresponding to the character code table in which all the character codes are defined as the character code used in the description of the data.
The character code converting means converts the data character code so that the data described by the character code specified by the character code analyzing means is described by the character code used in the operating system of the computer.

また、前記構成に加え、文字コード変換手段により文字コードを変換されたデータを解析して不要な文字列を削除するデータ解析手段を備えるようにしてもよい。   Further, in addition to the above-described configuration, a data analysis unit that analyzes data converted by the character code conversion unit and deletes unnecessary character strings may be provided.

プログラムの実行前に予め不用な文字列を削除しておくことにより、プログラムの誤動作やプログラムの実行に伴う異常の発生を未然に防止することができる。
データ解析手段は、不要な文字列として、少なくとも、連続するスペースを削除することが望ましい。
By deleting unnecessary character strings in advance before the execution of the program, it is possible to prevent the malfunction of the program and the occurrence of an abnormality accompanying the execution of the program.
The data analysis means desirably deletes at least continuous spaces as unnecessary character strings.

本発明の文字コード変換用プログラムは、ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前に前記データを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換用プログラムであり、前記と同様の課題を達成するため、
前記コンピュータを、前記データを記述している文字コードの特徴と予め前記コンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段として機能させることを特徴とした構成を有する。
The character code conversion program according to the present invention is a character code conversion for adapting a character code describing the data to a computer operating system before the data described in the file is read by a program operating on the computer. In order to achieve the same problem as described above,
Character code analysis means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance.
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer It has a configuration characterized by functioning.

この文字コード変換用プログラムを実装したコンピュータの作用は既に述べた通りである。   The operation of the computer in which this character code conversion program is installed is as described above.

また、この文字コード変換用プログラムにより、前記コンピュータを、更に、文字コード変換手段で文字コードを変換されたデータを解析して不要な文字列を削除するデータ解析手段として機能させるようにしてもよい。   In addition, the character code conversion program may cause the computer to further function as data analysis means for analyzing data whose character codes have been converted by the character code conversion means and deleting unnecessary character strings. .

この文字コード変換用プログラムを実装したコンピュータの作用は既に述べた通りである。   The operation of the computer in which this character code conversion program is installed is as described above.

本発明は、ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませるための前処理として、データを記述している文字コードの特徴と予めコンピュータに記憶されている何種類かの文字コードの特徴とを比較してデータを記述している文字コードを特定するようにしたので、オペレーションステムの名称やコンピュータ識別コード等を指定してデータを記述している文字コードやコンピュータのオペレーティングシステムで使用されている文字コードを明示する必要がない。従って、利用者側におけるコンピュータの操作ミス等によって文字コードの指定を誤るといった問題が解消され、適切な文字コード変換を行うことができる。
しかも、文字コード変換はプログラムが動作するコンピュータ上で実行されるので、文字コード変換のために別途コンピュータを準備する必要はなく、何らかの文字コードで記述されたデータが既に存在すれば、このデータを其のまま使用して当該コンピュータ上でプログラムを実行させることができる。
The present invention relates to the characteristics of character codes describing data and several kinds of character codes stored in advance in a computer as preprocessing for causing a program operating on the computer to read data described in a file. The character code that describes the data is specified by comparing with the characteristics of the system, so the character code that describes the data by specifying the name of the operation system, the computer identification code, etc. and the computer operating system There is no need to specify the character code used. Therefore, the problem of erroneously specifying the character code due to a computer operation error or the like on the user side can be solved, and appropriate character code conversion can be performed.
Moreover, since the character code conversion is executed on the computer on which the program operates, it is not necessary to prepare a separate computer for the character code conversion. If data written in some character code already exists, this data is converted. The program can be executed on the computer by using it as it is.

次に、本発明を実施するための最良の形態について、一例を挙げて説明する。図1は、本発明の文字コード変換方法を適用した文字コード変換機能付コンピュータ(以下、単にコンピュータという)の構成の概略を示した機能ブロック図である。   Next, the best mode for carrying out the present invention will be described with an example. FIG. 1 is a functional block diagram showing an outline of the configuration of a computer with a character code conversion function (hereinafter simply referred to as a computer) to which the character code conversion method of the present invention is applied.

このコンピュータ1は、図1に示される通り、ファイル7に記述されたデータを読み込むためのデータ読み込み手段2と、ファイル7のデータを記述している文字コードの特徴と予めコンピュータ1に記憶されている何種類かの文字コードの特徴とを比較してファイル7のデータを記述している文字コードを特定する文字コード解析手段3を備える。   As shown in FIG. 1, the computer 1 is preliminarily stored in the computer 1 with data reading means 2 for reading data described in the file 7, and character code characteristics describing the data in the file 7. Character code analysis means 3 is provided for identifying the character code describing the data of the file 7 by comparing the characteristics of several types of character codes.

また、文字コード解析手段3で特定された文字コードで記述されているデータがコンピュータ1のオペレーティングシステムで使用されている文字コードで記述されるようにデータの文字コードを変換する文字コード変換手段4と、文字コード変換手段4で文字コードを変換されたデータを解析して不要な文字列を削除するデータ解析手段5を備える。   The character code conversion means 4 converts the character code of the data so that the data described by the character code specified by the character code analysis means 3 is described by the character code used in the operating system of the computer 1. And data analysis means 5 for analyzing the data whose character code has been converted by the character code conversion means 4 and deleting unnecessary character strings.

文字コード変換手段4による文字コード変換を受けた上でデータ解析手段5によって不要な文字列を削除されたデータは、プログラム実行用のデータ記述ファイルとしてデータベース6内に保持されるようになっている。   Data that has undergone character code conversion by the character code conversion means 4 and from which unnecessary character strings have been deleted by the data analysis means 5 is held in the database 6 as a data description file for program execution. .

図2はコンピュータ1の実質的な構成について示したブロック図である。コンピュータ1は、図2に示される通り、演算処理用のCPU8、該CPU8の駆動制御プログラムを格納したROM9,演算データの一時記憶等に用いられるRAM10、大容量の不揮発性記憶手段として機能するハードディスクドライブ11、他のコンピュータや各種ネットワーク等に接続するためのインターフェイス12を有する。そして、CPU8の入出力回路13には、マン・マシン・インターフェイスを構成するディスプレイ14とキーボード15およびマウス16が接続され、更に、データ記憶媒体を介して外部のファイル7を読み込むためのフロッピーディスクドライブ17等が接続されている。   FIG. 2 is a block diagram showing a substantial configuration of the computer 1. As shown in FIG. 2, the computer 1 includes a CPU 8 for arithmetic processing, a ROM 9 that stores a drive control program for the CPU 8, a RAM 10 that is used for temporary storage of arithmetic data, and a hard disk that functions as a large-capacity nonvolatile storage means. The drive 11 has an interface 12 for connecting to other computers and various networks. The input / output circuit 13 of the CPU 8 is connected to a display 14 constituting a man-machine interface, a keyboard 15 and a mouse 16, and a floppy disk drive for reading an external file 7 via a data storage medium. 17 etc. are connected.

ハードディスクドライブ11には、本発明を適用した文字コード変換用プログラムが格納されており、この文字コード変換用プログラムをRAM10に読み出してCPU8に実行させることにより、CPU8が、データ読み込み手段2,文字コード解析手段3,文字コード変換手段4あるいはデータ解析手段5として機能するようになっている。   The hard disk drive 11 stores a character code conversion program to which the present invention is applied. By reading the character code conversion program into the RAM 10 and causing the CPU 8 to execute it, the CPU 8 causes the data reading means 2 and the character code to be read. It functions as analysis means 3, character code conversion means 4 or data analysis means 5.

ハードディスクドライブ11には、コンピュータ1上で動作する他のアプリケーションプログラムとして、例えば、ワープロソフト等が格納されている。   The hard disk drive 11 stores, for example, word processing software as another application program that operates on the computer 1.

また、このハードディスクドライブ11は、プログラム実行用のデータ記述ファイルを保持するためのデータベース6として機能する他、読み込みの対象となるデータの文字コードとして想定される文字コードの特徴を記憶した記憶手段としても機能する。   The hard disk drive 11 functions as a database 6 for holding a data description file for program execution, and also serves as storage means for storing character code characteristics assumed as character codes of data to be read. Also works.

図3,図4,図5は、ハードディスクドライブ11に予め記憶させておいた文字コード表の一例を示した概念図である。   3, 4, and 5 are conceptual diagrams showing examples of character code tables stored in the hard disk drive 11 in advance.

ここでは、便宜上、図3の文字コード表を文字コード表1、図4の文字コード表を文字コード表2、図5の文字コード表を文字コード表3と呼ぶことにする。   Here, for the sake of convenience, the character code table in FIG. 3 is referred to as character code table 1, the character code table in FIG. 4 is referred to as character code table 2, and the character code table in FIG.

このうち、コンピュータ1のオペレーティングシステムが実際に使用している文字コードは図3の文字コード表1に対応した文字コードであり、図4の文字コード表2と図5の文字コード表3は、読み込みの対象となるデータの文字コードとして想定される文字コードの特徴として記憶された文字コード表である。   Among these, the character code actually used by the operating system of the computer 1 is a character code corresponding to the character code table 1 in FIG. 3, and the character code table 2 in FIG. 4 and the character code table 3 in FIG. It is the character code table memorize | stored as the characteristic of the character code assumed as a character code of the data used as the object of reading.

図3,図4,図5は、何れも2バイト文字コード表の例であり、上位1バイト(H)の数値と下位1バイト(L)の数値からなる文字コード(H,L)で文字コード表のスポット(H,L)を指定することで、各文字コード表に固有の文字を指定するように構成されている。   3, 4, and 5 are examples of a 2-byte character code table. Characters are represented by a character code (H, L) consisting of a numerical value of the upper 1 byte (H) and a numerical value of the lower 1 byte (L). By designating the spot (H, L) of the code table, a character unique to each character code table is designated.

ここで、仮に、図5の文字コード表3の文字コード(H,L)=(0,3)が文字「0」を示すものであると仮定すると、図5の文字コード表3を使用している別のコンピュータ上で動作するプログラム、例えば、ワープロソフトで作成されたデータで文字「0」を表示するために文字コード(H,L)=(0,3)が使用されていた場合、この文字コード(H,L)=(0,3)をコンピュータ1上で動作するワープロソフトに其のまま読み込むと、このコンピュータ1のオペレーティングシステムが使用する図3の文字コード表1で文字コード(H,L)=(0,3)が指定されることになるが、図3の文字コード表1では文字コード(H,L)=(0,3)の文字は未定義であるから、最初に意図した文字「0」が表示されないか、あるいは、エラーが検出されてコンピュータ1上で動作するワープロソフトの動作が停止するといった問題が生じる場合がある。つまり、文字コードの相違から文字コード自体の解釈が不能となる場合がある。   Here, assuming that the character code (H, L) = (0, 3) in the character code table 3 of FIG. 5 indicates the character “0”, the character code table 3 of FIG. 5 is used. If the character code (H, L) = (0, 3) is used to display the character “0” in a program that runs on another computer, for example, data created by word processing software, When this character code (H, L) = (0, 3) is read as it is into a word processing software operating on the computer 1, the character code ((1) in the character code table 1 of FIG. H, L) = (0, 3) is specified, but the character code (H, L) = (0, 3) is undefined in the character code table 1 of FIG. The intended character “0” is not displayed on the There may problem operation of word processing software running on the computer 1 is detected an error is stopped occurs. That is, the character code itself may not be interpreted due to the difference in the character code.

また、仮に、図4の文字コード表2の文字コード(H,L)=(3,2)が文字「#」を示し、図3の文字コード表1の文字コード(H,L)=(3,2)が文字「2」を示すものであると仮定すると、図4の文字コード表2を使用している別のコンピュータ上で動作するプログラムで作成されたデータで文字「#」を表示するために文字コード(H,L)=(3,2)が使用されていた場合、この文字コード(H,L)=(3,2)をコンピュータ1上で動作するワープロソフトに其のまま読み込むと、このコンピュータ1のオペレーティングシステムが使用する図3の文字コード表1で文字コード(H,L)=(3,2)が指定され、結果的に、最初に意図した文字「#」ではなく文字「2」が表示されるといった問題が生じる。つまり、文字コードの解釈は可能であっても、文字コードの相違から意図した文字が表示されなくなる場合がある。   Further, suppose that the character code (H, L) = (3, 2) in the character code table 2 in FIG. 4 indicates the character “#”, and the character code (H, L) = (in the character code table 1 in FIG. Assuming that 3) and 2) indicate the character "2", the character "#" is displayed with data created by a program operating on another computer using the character code table 2 of FIG. When the character code (H, L) = (3, 2) is used for this purpose, the character code (H, L) = (3, 2) is used as it is in the word processor software operating on the computer 1. When read, the character code (H, L) = (3, 2) is specified in the character code table 1 of FIG. 3 used by the operating system of the computer 1, and as a result, the first intended character "#" There is a problem that the character “2” is displayed instead. That is, even if the character code can be interpreted, the intended character may not be displayed due to the difference in the character code.

この場合、実際には、図3の文字コード表1においては文字「#」が文字コード(H,L)=(2,3)で定義されているので、図4の文字コード表2を使用している別のコンピュータ上で動作するワープロソフトで作成されたデータをコンピュータ1上で動作するワープロソフトに読み込む際に、文字コード(H,L)=(3,2)の指定を文字コード(H,L)=(2,3)の指定に変換する処理を行えば、別のコンピュータ上で動作するワープロソフトで作成された文字「#」をコンピュータ1上で動作するワープロソフトにおいても文字「#」として意図した通りに適切に表示することが可能である。   In this case, the character “#” is actually defined by the character code (H, L) = (2, 3) in the character code table 1 of FIG. 3, and therefore the character code table 2 of FIG. 4 is used. When data created by a word processing software operating on another computer is read into a word processing software operating on the computer 1, the character code (H, L) = (3, 2) is designated as a character code ( If the process of conversion to the designation of (H, L) = (2, 3) is performed, the character “#” created by the word processor software that operates on another computer is also converted to the character “ "#" Can be displayed appropriately as intended.

このようにして、異なる文字コード表を使用するコンピュータ間あるいはアプリケーション間で、文字コード表の組み合わせに適合した特定のルールを適用して文字コード変換を行う技術については既に公知であるが、この種の技術を適用して適切な文字コード変換を行うためには、各々のコンピュータあるいはアプリケーションが使用している文字コードが明らかになっていなければならないとった制限がある。また、文字コードが明らかになっていたとしても、各々のコンピュータあるいはアプリケーションが使用している文字コード、あるいは、文字コードを特定するために必要とされるオペレーションステムの名称やコンピュータ識別コード等をコンピュータに教示するのは利用者自身の役目となるので、利用者がコンピュータの操作をミスすれば、適切な文字コード変換は行えなくなってしまう。   As described above, a technique for performing character code conversion by applying a specific rule that is suitable for a combination of character code tables between computers or applications that use different character code tables is already known. In order to perform appropriate character code conversion by applying this technique, there is a limitation that the character code used by each computer or application must be made clear. In addition, even if the character code is clear, the character code used by each computer or application, or the name of the operation system or computer identification code required to specify the character code Therefore, if the user makes a mistake in operating the computer, proper character code conversion cannot be performed.

こういった不都合を解消するため、この実施の形態では、データを記述している文字コードの特徴と予めコンピュータ1に記憶されている何種類かの文字コードの特徴とをコンピュータ1によって比較させ、データを記述している文字コードをコンピュータ1の内部処理によって特定させるようにしている。   In order to eliminate such inconvenience, in this embodiment, the computer 1 compares the characteristics of the character code describing the data with the characteristics of several types of character codes stored in the computer 1 in advance. The character code describing the data is specified by internal processing of the computer 1.

次に、コンピュータ1上で動作するワープロソフト等のアプリケーションプログラムに他のコンピュータで作成されたファイル7のデータを読み込ませる際にCPU8が実行する前処理の概略を示した図7,図8のフローチャートを参照して、データ読み込み手段2,文字コード解析手段3,文字コード変換手段4,データ解析手段5として機能するCPU8の処理動作について具体的に説明する。   Next, flowcharts of FIGS. 7 and 8 showing an outline of preprocessing executed by the CPU 8 when an application program such as word processing software operating on the computer 1 reads data of the file 7 created by another computer. The processing operation of the CPU 8 functioning as the data reading means 2, the character code analyzing means 3, the character code converting means 4, and the data analyzing means 5 will be specifically described.

前述した通り、ハードディスクドライブ11には、本発明を適用した文字コード変換用プログラムが格納されており、この文字コード変換用プログラムをRAM10に読み出してCPU8が実行することで、この前処理が開始され、CPU8が、データ読み込み手段2,文字コード解析手段3,文字コード変換手段4あるいはデータ解析手段5として機能することになる。   As described above, the character code conversion program to which the present invention is applied is stored in the hard disk drive 11, and this character code conversion program is read into the RAM 10 and executed by the CPU 8 to start the preprocessing. The CPU 8 functions as the data reading means 2, the character code analyzing means 3, the character code converting means 4 or the data analyzing means 5.

前処理が開始されると、まず、データ読み込み手段2として機能するCPU8が、指定されたファイル7から文字コードで記述された一連のデータを読み込んでRAM10にバックアップとして一時記憶する(ステップS1)。   When the preprocessing is started, first, the CPU 8 functioning as the data reading means 2 reads a series of data described in character codes from the designated file 7 and temporarily stores it as a backup in the RAM 10 (step S1).

元データであるファイル7自体はコンピュータ1の内部(ハードディスクドライブ11内)に存在しても外部に存在しても構わないが、外部からの読み込みが必要な場合には、インターフェイス12を使用した他のコンピュータとのネットワーク接続、あるいは、ファイル7を収めたデータ記憶媒体とフロッピーディスクドライブ17等を利用するものとする。   The file 7 that is the original data may exist inside the computer 1 (in the hard disk drive 11) or outside, but if reading from the outside is necessary, the interface 12 is used. Or a data storage medium containing the file 7 and a floppy disk drive 17 or the like.

次いで、CPU8は、文字コード表選択指標jを0に初期化し(ステップS2)、該指標jの値を改めて1インクリメントした後(ステップS3)、ヒット数カウンタkの値を0に初期化する(ステップS4)。   Next, the CPU 8 initializes the character code table selection index j to 0 (step S2), increments the value of the index j by 1 again (step S3), and then initializes the value of the hit number counter k to 0 (step S3). Step S4).

そして、文字コード解析手段3として機能するCPU8が、RAM10に一時記憶されたファイル7の先頭からデータを記述している文字コードを1つ読み込み(ステップS5)、文字コード表選択指標jの現在値で特定される文字コード表jを検索して、当該1文字コードが文字コード表jで定義されているか否かを判定する(ステップS6)。   Then, the CPU 8 functioning as the character code analyzing means 3 reads one character code describing data from the head of the file 7 temporarily stored in the RAM 10 (step S5), and the current value of the character code table selection index j. The character code table j specified in (1) is searched to determine whether or not the one character code is defined in the character code table j (step S6).

仮に、現時点でj=1、また、ステップS5の処理で読み込んだ1文字コードが(H,L)=(3,2)であったとすれば、図3の文字コード表1(=j)の(H,L)=(3,2)には文字「2」が定義されているので、ステップS6の判定結果は真となる。この場合、ファイル7のデータを記述している文字コード表が図3,図4,図5の何れのものであってもステップS6の判定結果は真となるので、ファイル7のデータの記述に用いられた文字コードが不明な現段階では、データを記述している文字コード(H,L)=(3,2)によって文字「2」,文字「#」の何れが指定されるのかは特定し得ない。要するに、この時点で問題となるのは、ステップS5の処理で読み込んだ1文字コード(H,L)によって指定される文字コード表jの(H,L)スポットに何らかの文字が定義されているか否かのみである。   If j = 1 at the present time and the one character code read in step S5 is (H, L) = (3, 2), the character code table 1 (= j) in FIG. Since the character “2” is defined in (H, L) = (3, 2), the determination result in step S6 is true. In this case, even if the character code table describing the data of the file 7 is any of those shown in FIG. 3, FIG. 4 and FIG. At the present stage when the character code used is unknown, it is specified which character “2” or character “#” is designated by the character code (H, L) = (3, 2) describing the data I can't. In short, what matters at this point is whether or not any character is defined in the (H, L) spot of the character code table j specified by the one character code (H, L) read in the process of step S5. Only.

ここで、ステップS6の判定結果が真となって当該1文字コードが文字コード表jで定義されていることが明らかとなった場合には、文字コード解析手段3として機能するCPU8がヒット数カウンタkの値を1インクリメントし(ステップS7)、該カウンタkの現在値がコード識別基準値mに達しているか否かを判定する(ステップS8)。   Here, when the determination result in step S6 is true and it is clear that the one character code is defined in the character code table j, the CPU 8 functioning as the character code analyzing means 3 detects the hit number counter. The value of k is incremented by 1 (step S7), and it is determined whether or not the current value of the counter k has reached the code identification reference value m (step S8).

コード識別基準値mは、ファイル7のデータを記述している文字コードが、文字コード表選択指標jで特定される文字コード表jと一致するか否かを判定するための基準値である。   The code identification reference value m is a reference value for determining whether or not the character code describing the data of the file 7 matches the character code table j specified by the character code table selection index j.

ステップS8の判定結果が偽となってヒット数カウンタkの現在値がコード識別基準値mに達していないことが明らかとなった場合には、文字コード解析手段3として機能するCPU8は、RAM10に一時記憶されているファイル7から改めて次の文字コードを1つ読み込む(ステップS5)。そして、当該1文字コードが文字コード表jで定義されていないことがステップS6の判定処理で確認されるか、あるいは、カウンタkの現在値がコード識別基準値mに達したことがステップS8の処理で確認されるまでの間、ヒット数カウンタkの値を逐次インクリメントしながら、前記と同様にして、ステップS5〜ステップS8の処理を繰り返し実行する。   When the determination result in step S8 is false and it is clear that the current value of the hit number counter k has not reached the code identification reference value m, the CPU 8 functioning as the character code analysis means 3 stores in the RAM 10. One next character code is read from the temporarily stored file 7 (step S5). In step S8, it is confirmed in step S6 that the one character code is not defined in the character code table j, or that the current value of the counter k has reached the code identification reference value m. Until the processing is confirmed, the processing from step S5 to step S8 is repeatedly executed in the same manner as described above while sequentially incrementing the value of the hit number counter k.

このような処理を繰り返し実行する間にステップS6の判定結果が偽となった場合には、ファイル7のデータが文字コード表jで定義されていない文字コードを使用して記述されていること、つまり、ファイル7のデータが文字コード表j以外の文字コード表を使用して記述されていることを意味する。   If the determination result in step S6 becomes false while repeatedly executing such processing, the data in the file 7 is described using a character code that is not defined in the character code table j. That is, it means that the data of the file 7 is described using a character code table other than the character code table j.

従って、文字コード解析手段3として機能するCPU8は、文字コード表選択指標jの現在値が、ハードディスクドライブ11に予め記憶させておいた文字コード表の総数n(=3)に達しているか否か、即ち、ファイル7のデータを記述している文字コードの特徴と予めコンピュータ1に記憶させておいた文字コード表の特徴との比較が全て完了しているか否かを判定することになる(ステップS9)。   Therefore, the CPU 8 functioning as the character code analyzing means 3 determines whether or not the current value of the character code table selection index j has reached the total number n (= 3) of the character code tables stored in the hard disk drive 11 in advance. That is, it is determined whether or not all the comparisons between the characteristics of the character code describing the data of the file 7 and the characteristics of the character code table stored in the computer 1 in advance have been completed (step). S9).

ステップS9の判定結果が真となった場合には、ファイル7のデータを記述している文字コードの特徴と予めコンピュータ1に記憶させておいた幾つかの文字コード表の特徴との比較が全て完了しており、しかも、ファイル7のデータを記述している文字コードの特徴が予めコンピュータ1に記憶させておいた何れの文字コード表の特徴とも一致しないことを意味する。この場合、読み込みの対象となるデータの文字コードとして想定されていなかった文字コードによってファイル7のデータが記述されていることになるので、文字コードの変換は不能となり、文字コード変換に関わる前処理はこの時点で中断される。   If the determination result in step S9 is true, all the comparisons between the characteristics of the character code describing the data of the file 7 and the characteristics of several character code tables stored in the computer 1 in advance are all performed. This means that the feature of the character code describing the data of the file 7 does not match the feature of any character code table stored in the computer 1 in advance. In this case, since the data of the file 7 is described by the character code that was not assumed as the character code of the data to be read, the character code conversion becomes impossible, and the pre-processing related to the character code conversion Is interrupted at this point.

一方、ステップS9の判定結果が偽となった場合には、ファイル7のデータを記述している文字コードの特徴との比較が行われていない文字コード表が未だ残っていることを意味し、ファイル7のデータを記述している文字コードの特徴が他の文字コード表の特徴と一致する可能性があるので、文字コード解析手段3として機能するCPU8は、文字コード表選択指標jの値を1インクリメントし、該指標jの現在値に基づいて別の文字コード表jを改めて選択し直し(ステップS3)、ヒット数カウンタkの値を0に初期化した後(ステップS4)、前記と同様にしてステップS5〜ステップS8の処理を繰り返し実行する。   On the other hand, if the determination result of step S9 is false, it means that there is still a character code table that has not been compared with the character code characteristics describing the data of the file 7, Since the characteristic of the character code describing the data of the file 7 may match the characteristic of the other character code table, the CPU 8 functioning as the character code analysis means 3 determines the value of the character code table selection index j. 1 is incremented, another character code table j is selected again based on the current value of the index j (step S3), the value of the hit number counter k is initialized to 0 (step S4), and the same as above Then, the process from step S5 to step S8 is repeatedly executed.

そして、このような処理を繰り返し実行する間にステップS8の判定結果が真となった場合には、RAM10にバックアップとして記憶されたファイル7の先頭から順に読み込まれた文字コードが、少なくとも先頭から連続してm個だけ文字コード表jに定義されていることを意味するので、文字コード解析手段3として機能するCPU8は、ファイル7のデータが文字コード表jの文字コードで記述されているものと判定し、前述のループ処理を終了する。   If the determination result in step S8 becomes true while repeatedly executing such processing, the character code read in order from the top of the file 7 stored as a backup in the RAM 10 is continuous from at least the top. This means that only m characters are defined in the character code table j. Therefore, the CPU 8 functioning as the character code analyzing means 3 is assumed that the data in the file 7 is described by the character code in the character code table j. Determination is made, and the above loop processing is terminated.

図3,図4,図5に例示したように、文字コード表は、その種別によって文字が未定義となっているスポット(H,L)の分布状態が相違するので、ファイル7のデータを記述している文字コードの幾つか、例えば、先頭からm個を抽出し、抽出された文字コードの全てが定義された文字コード表を求めれば、ファイル7のデータが何れの文字コード表に基いて生成されたものであるのかを知ることができる。なお、十分な確度で文字コード表を特定するに足るコード識別基準値mの値は予め求めておくものとする。   As illustrated in FIGS. 3, 4, and 5, the character code table describes the data of the file 7 because the distribution state of the spot (H, L) where the character is undefined differs depending on the type. If some character codes, for example, m from the beginning are extracted and a character code table in which all the extracted character codes are defined is obtained, the data in the file 7 is based on which character code table. You can know if it was generated. It is assumed that the code identification reference value m sufficient to specify the character code table with sufficient accuracy is obtained in advance.

以上のようにしてファイル7のデータを記述している文字コードに対応した文字コード表jを特定した後、CPU8は、文字コード表選択指標jの現在値が1であるか否か、即ち、ファイル7のデータを記述している文字コードとコンピュータ1のオペレーティングシステムが実際に使用している文字コードとが同じものであるか否かを判定する(ステップS10)。   After specifying the character code table j corresponding to the character code describing the data of the file 7 as described above, the CPU 8 determines whether or not the current value of the character code table selection index j is 1, that is, It is determined whether the character code describing the data in the file 7 is the same as the character code actually used by the operating system of the computer 1 (step S10).

ステップS10の判定結果が真となった場合には、ファイル7のデータを記述している文字コードとコンピュータ1のオペレーティングシステムが実際に使用している文字コードとが同じものであり、共に文字コード表1に基くものであることを意味するので、実質的な文字コード変換は不要であり、このファイル7が、RAM10内に其のまま保持されることになる。   If the determination result in step S10 is true, the character code describing the data of the file 7 and the character code actually used by the operating system of the computer 1 are the same, both character codes Since it means that it is based on Table 1, substantial character code conversion is unnecessary, and this file 7 is held in the RAM 10 as it is.

一方、ステップS10の判定結果が偽となった場合には、ファイル7のデータを記述している文字コードとコンピュータ1のオペレーティングシステムが実際に使用している文字コードとが相違することを意味するので、文字コード変換手段4として機能するCPU8は、ファイル7のデータを記述している文字コード表jとコンピュータ1のオペレーティングシステムが実際に使用している文字コード表1との組み合わせに適合したルールを適用して公知の文字コード変換を実行することで、文字コード表jに対応した文字コードで記述されているファイル7のデータが、コンピュータ1のオペレーティングシステムで使用する文字コード表1の文字コードで記述されるようにファイル7におけるデータの文字コードを変換し(ステップS11)、文字コード変換されたファイル7を改めてRAM10に上書きして一時記憶する(ステップS12)。   On the other hand, if the determination result in step S10 is false, it means that the character code describing the data in the file 7 is different from the character code actually used by the operating system of the computer 1. Therefore, the CPU 8 functioning as the character code conversion means 4 is a rule adapted to the combination of the character code table j describing the data of the file 7 and the character code table 1 actually used by the operating system of the computer 1. Is used to execute known character code conversion, so that the data in the file 7 described in the character code corresponding to the character code table j becomes the character code in the character code table 1 used in the operating system of the computer 1. The character code of the data in the file 7 is converted as described in (Step S 1), and temporarily stores overwrite files 7 that has been converted character code anew in RAM 10 (step S12).

この際、ステップS1の処理でバックアップとしてRAM10に読み込まれた作業用のファイル7のデータは失われるが、コンピュータ1の内部(ハードディスクドライブ11内)あるいはファイル7を収めたデータ記憶媒体内の元データはそのまま保持される。   At this time, the data of the working file 7 read into the RAM 10 as a backup in step S1 is lost, but the original data in the computer 1 (in the hard disk drive 11) or in the data storage medium containing the file 7 is lost. Is retained as is.

次いで、データ解析手段5として機能するCPU8が、RAM10に一時記憶されている文字コード変換後のファイル7の先頭からデータを記述している文字コードを1つ読み込み(ステップS13)、当該文字コードがスペースを表すものであるか否かを判定する(ステップS14)。   Next, the CPU 8 functioning as the data analysis means 5 reads one character code describing data from the beginning of the file 7 after character code conversion temporarily stored in the RAM 10 (step S13). It is determined whether or not it represents a space (step S14).

文字コードがスペースを表すものでなければ、CPU8は、連続スペース記憶フラグFをリセットし(ステップS15)、この文字コードをファイル7に対応するプログラム実行用のデータ記述ファイル7’の適正なデータとしてハードディスクドライブ11のデータベース6内に保存する(ステップS18)。   If the character code does not represent a space, the CPU 8 resets the continuous space storage flag F (step S15), and uses this character code as appropriate data in the data description file 7 ′ for program execution corresponding to the file 7. The data is stored in the database 6 of the hard disk drive 11 (step S18).

一方、ステップS14の判定結果が真となって当該文字コードがスペースを表すものであることが確認された場合には、CPU8は、更に、この時点で既に連続スペース記憶フラグFがセットされているか否か、つまり、今回読み込まれたスペースが連続する2個目以降のスペースであるか否かを判定することになる(ステップS16)。   On the other hand, if the determination result in step S14 is true and it is confirmed that the character code represents a space, the CPU 8 further determines whether the continuous space storage flag F has already been set at this time. In other words, it is determined whether or not the currently read space is the second and subsequent spaces (step S16).

ステップS16の判定結果が偽となった場合には、今回読み込まれたスペースが最初のスペースもしくは通常の文字に連続する1個目のスペースであることを意味するので、CPU8は、連続スペース記憶フラグFをセットした後(ステップS17)、このスペースが有効な文字列であると見做して、前記と同様に、このスペースを表している文字コードをファイル7に対応するプログラム実行用のデータ記述ファイル7’の適正なデータとして、ハードディスクドライブ11のデータベース6内に続けて保存する(ステップS18)。   If the determination result in step S16 is false, it means that the space read this time is the first space or the first space that is continuous with normal characters, so the CPU 8 determines the continuous space storage flag. After setting F (step S17), assuming that this space is a valid character string, the character code representing this space is described in the data description for program execution corresponding to the file 7 as described above. As the appropriate data of the file 7 ', it is continuously stored in the database 6 of the hard disk drive 11 (step S18).

これに対し、ステップS16の判定結果が真となった場合には、今回読み込まれたスペースが連続する2個目以降のスペースであることを意味するので、データ解析手段5として機能するCPU8は、このスペースが不要な文字列であると見做してステップS18の処理をスキップし、ファイル7に対応するプログラム実行用のデータ記述ファイル7’への当該文字コードの保存を禁止する。   On the other hand, if the determination result in step S16 is true, this means that the space read this time is the second and subsequent spaces, so the CPU 8 functioning as the data analysis means 5 Assuming that this space is an unnecessary character string, the process of step S18 is skipped, and the storage of the character code in the data description file 7 ′ for program execution corresponding to the file 7 is prohibited.

次いで、CPU8は、今回読み込まれた文字コードがファイル7に記述されている最後の文字コードであるか否かを判定し(ステップS19)、最後の文字コードでなければ、RAM10に一時記憶されている文字コード変換後のファイル7から次のデータを記述している文字コードを1つ読み込む(ステップS13)。そして、ファイル7に記述されている最後の文字コードがステップS19の処理で検出されるまでの間、データ解析手段5として機能するCPU8が、前記と同様にして、ステップS13〜ステップ18の処理を繰り返し実行する。   Next, the CPU 8 determines whether or not the character code read this time is the last character code described in the file 7 (step S19). If it is not the last character code, it is temporarily stored in the RAM 10. One character code describing the next data is read from the file 7 after conversion of the existing character code (step S13). Then, until the last character code described in the file 7 is detected in the process of step S19, the CPU 8 functioning as the data analysis means 5 performs the processes of step S13 to step 18 in the same manner as described above. Run repeatedly.

従って、文字コード変換されたファイル7に2以上のスペースが連続して存在する場合には、最初のスペースを記述している文字コードのみが有効な文字列として認識され、これに連続したスペースを記述する文字コードはデータ解析手段5により不要な文字列としてファイル7から削除され、不要な文字列の削除されたファイル7が、プログラム実行用のデータ記述ファイル7’としてデータベース6内に保存されることになる。   Therefore, when two or more spaces are continuously present in the character code converted file 7, only the character code describing the first space is recognized as a valid character string, and the continuous space is replaced with this. The character code to be described is deleted from the file 7 as an unnecessary character string by the data analysis means 5, and the file 7 from which the unnecessary character string has been deleted is stored in the database 6 as a data description file 7 'for program execution. It will be.

一般に、コンピュータのオペレーティングシステムやワープロソフト等のアプリケーションプログラムの相違あるいは文字コードの相違等により、改行処理にラインフィード(LF)を利用するもの、キャリッジリターン(CR)を利用するもの、更には、ラインフィード(LF)とキャリッジリターン(CR)を組み合わせて利用するものがあり、これらの間で文字コード変換を行うと、実質的な意味のない多数のスペースから成る文字列が生成される場合があるが、このようにして連続するスペースを削除することによって不要な文字列を削除することができる。   Generally, those that use line feed (LF) for line feed processing, those that use carriage return (CR) due to differences in application programs such as computer operating systems and word processing software, or character codes, etc. Some use a combination of feed (LF) and carriage return (CR). When character code conversion is performed between them, a character string consisting of a large number of spaces having no substantial meaning may be generated. However, unnecessary character strings can be deleted by deleting consecutive spaces in this way.

最終的に、適切な文字コード変換を施し且つ不要な文字列を削除したプログラム実行用のデータ記述ファイル7’を元データであるファイル7に代えて当該コンピュータ1上で動作するアプリケーションプログラム、例えば、ワープロソフト等に読み込ませることにより、ファイル7のデータがどのような文字コードで記述されていたかに関わりなく、当該コンピュータ1上で作成したファイルの場合と同様に、ワープロソフト等のアプリケーションプログラムを利用した処理操作を的確に実行させることができる。   Finally, an application program that runs on the computer 1 instead of the data description file 7 ′ for program execution that has been subjected to appropriate character code conversion and deleted unnecessary character strings in place of the file 7 that is the original data, for example, Regardless of what character code the data in file 7 is written in by using word processor software or the like, application programs such as word processor software are used in the same way as with files created on computer 1 The processing operation performed can be executed accurately.

この実施の形態では、ファイル7に対する文字コード変換が、ワープロソフト等のアプリケーションプログラムを動作させるコンピュータ1上で実行されるので、文字コード変換のために別途コンピュータを準備する必要はなく、何らかの文字コードで記述されたファイル7が既に存在すれば、前述の前処理をファイル7に施すだけで、このファイルを其のまま使用してプログラムを確実に実行させることができる。   In this embodiment, since the character code conversion for the file 7 is executed on the computer 1 that runs an application program such as word processing software, it is not necessary to prepare a separate computer for character code conversion. If the file 7 described in (1) already exists, it is possible to execute the program by using the file as it is by simply performing the above-described preprocessing on the file 7.

また、アプリケーションプログラムの実行前に予め不用な文字列を削除しておくようにしているので、アプリケーションプログラムの誤動作やアプリケーションプログラムの実行に伴う異常の発生も未然に防止することができる。   In addition, since unnecessary character strings are deleted in advance before the execution of the application program, it is possible to prevent the malfunction of the application program and the occurrence of an abnormality accompanying the execution of the application program.

図7に示されるようなデータ解析手段5の処理は、当該コンピュータ1で文字コード変換を行った場合(ステップS10の判定結果が偽となった場合)、あるいは、他のコンピュータで文字コード変換を施して文字コードを整合したファイルを当該コンピュータ1に持ち込んだ場合(ステップS10の判定結果が真となった場合)の何れにおいても実行されるので、他のコンピュータで文字コード変換を施したファイル7から不要な文字列を削除するといったデバッグ処理にも利用可能である。   The processing of the data analysis means 5 as shown in FIG. 7 is performed when the character code conversion is performed by the computer 1 (when the determination result of step S10 is false), or the character code conversion is performed by another computer. Since the file is executed in any case where the file with the matched character code is brought into the computer 1 (when the determination result in step S10 is true), the file 7 subjected to character code conversion in another computer is executed. It can also be used for debugging such as deleting unnecessary character strings.

ここでは、一例として、スペースの連続を不用意な文字列と認識して削除する場合について述べたが、コンピュータ1上で動作するアプリケーションプログラムの特性、つまり、プログラム実行用のデータ記述ファイル7’を読み込むプログラムの特性に応じ、他の文字列を不要な文字列として削除したり、更には、データフォーマットの変換等を行うように設計してもよい。   Here, as an example, the case where a series of spaces is recognized and deleted as an inadvertent character string has been described as an example. Depending on the characteristics of the program to be read, other character strings may be deleted as unnecessary character strings, and further, data format conversion or the like may be performed.

本発明の文字コード変換方法を適用した文字コード変換機能付コンピュータの構成の概略を示した機能ブロック図である。It is a functional block diagram showing an outline of a configuration of a computer with a character code conversion function to which the character code conversion method of the present invention is applied. 文字コード変換機能付コンピュータの実質的な構成について示したブロック図である。It is the block diagram shown about the substantial structure of the computer with a character code conversion function. 文字コード変換機能付コンピュータのオペレーティングシステムが使用している文字コード表の一例を示した概念図である。It is the conceptual diagram which showed an example of the character code table | surface used by the operating system of the computer with a character code conversion function. 読み込みの対象となるデータの文字コードとして想定される文字コードの特徴として記憶された文字コード表の一例を示した概念図である。It is the conceptual diagram which showed an example of the character code table memorize | stored as a characteristic of the character code assumed as a character code of the data used as the object of reading. 読み込みの対象となるデータの文字コードとして想定される文字コードの特徴として記憶された文字コード表の他の一例を示した概念図である。It is the conceptual diagram which showed another example of the character code table memorize | stored as a characteristic of the character code assumed as a character code of the data used as the object of reading. 文字コード変換機能付コンピュータのCPUが実行する前処理(文字コード変換用プログラム)の概略を示したフローチャートである。It is the flowchart which showed the outline of the preprocessing (program for character code conversion) which CPU of a computer with a character code conversion function performs. 文字コード変換機能付コンピュータのCPUが実行する前処理(文字コード変換用プログラム)の概略を示したフローチャートの続きである。It is the continuation of the flowchart which showed the outline of the preprocessing (program for character code conversion) which CPU of a computer with a character code conversion function performs.

符号の説明Explanation of symbols

1 文字コード変換機能付コンピュータ
2 データ読み込み手段
3 文字コード解析手段
4 文字コード変換手段
5 データ解析手段
6 データベース
7 ファイル
8 CPU(文字コード解析手段,文字コード変換手段,データ解析手段)
9 ROM
10 RAM
11 ハードディスクドライブ
12 インターフェイス
13 入出力回路
14 ディスプレイ
15 キーボード
16 マウス
17 フロッピーディスクドライブ
1 computer with character code conversion function 2 data reading means 3 character code analyzing means 4 character code converting means 5 data analyzing means 6 database 7 file 8 CPU (character code analyzing means, character code converting means, data analyzing means)
9 ROM
10 RAM
11 Hard Disk Drive 12 Interface 13 Input / Output Circuit 14 Display 15 Keyboard 16 Mouse 17 Floppy Disk Drive

Claims (9)

ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前に前記データを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換方法であって、
読み込みの対象となるデータの文字コードとして想定される文字コードの特徴を予め前記コンピュータに記憶させておき、
前記データを前記プログラムに読み込ませるための前処理として、前記データを記述している文字コードの特徴と予め前記コンピュータに記憶されている何種類かの文字コードの特徴とを比較して前記データを記述している文字コードを特定し、
前記特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データに対して文字コード変換を行い、
文字コード変換によって生成された新たなファイルをプログラム実行用のデータ記述ファイルとして保持することを特徴とした文字コード変換方法。
A character code conversion method for adapting a character code describing the data to a computer operating system before the data described in the file is read by a program running on the computer,
Characteristic of the character code assumed as the character code of the data to be read is stored in the computer in advance,
As preprocessing for causing the program to read the data, the characteristics of the character code describing the data are compared with the characteristics of several types of character codes stored in the computer in advance. Identify the character code you are describing,
Performing character code conversion on the data so that the data described in the specified character code is described in a character code used in an operating system of the computer;
A character code conversion method characterized by holding a new file generated by character code conversion as a data description file for program execution.
文字コード変換の際に生成された不要な文字列を削除してプログラム実行用のデータ記述ファイルとして保持することを特徴とした請求項1記載の文字コード変換方法。   2. The character code conversion method according to claim 1, wherein an unnecessary character string generated at the time of character code conversion is deleted and held as a data description file for program execution. 不要な文字列として、少なくとも、連続するスペースを削除することを特徴とした請求項2記載の文字コード変換方法。   3. The character code conversion method according to claim 2, wherein at least a continuous space is deleted as an unnecessary character string. 読み込みの対象となるデータの文字コードとして想定される文字コードの特徴として、文字コード表を記憶させておくことを特徴とした請求項1,請求項2または請求項3記載の文字コード変換方法。   4. The character code conversion method according to claim 1, wherein a character code table is stored as a character code characteristic assumed as a character code of data to be read. 特徴の比較に際し、データを記述している文字コードの幾つかを抽出し、この文字コードに対応する文字が前記文字コード表に定義されている場合に、前記データを記述している文字コードが当該文字コード表の文字コードであると特定することを特徴とした請求項4記載の文字コード変換方法。   When comparing the characteristics, when some of the character codes describing the data are extracted and the characters corresponding to the character codes are defined in the character code table, the character code describing the data is 5. The character code conversion method according to claim 4, wherein the character code is specified as a character code in the character code table. データを記述している文字コードの特徴と予めコンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段と、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段とを備えたことを特徴とする文字コード変換機能付コンピュータ。
Character code analyzing means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance,
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer; A computer with a character code conversion function.
データを記述している文字コードの特徴と予めコンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段と、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段と、
前記文字コード変換手段で文字コードを変換されたデータを解析して不要な文字列を削除するデータ解析手段とを備えたことを特徴とする文字コード変換機能付コンピュータ。
Character code analyzing means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance,
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer; ,
A computer with a character code conversion function, comprising: data analysis means for analyzing the data whose character code has been converted by the character code conversion means and deleting unnecessary character strings.
ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前に前記データを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換用プログラムであって、
前記コンピュータを、前記データを記述している文字コードの特徴と予め前記コンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段として機能させるための文字コード変換用プログラム。
A character code conversion program for adapting a character code describing the data to a computer operating system before reading the data described in the file into a program operating on the computer,
Character code analysis means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance.
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer Character code conversion program to make it function.
ファイルに記述されたデータをコンピュータ上で動作するプログラムに読み込ませる前に前記データを記述している文字コードをコンピュータのオペレーティングシステムに適合させるための文字コード変換用プログラムであって、
前記コンピュータを、前記データを記述している文字コードの特徴と予め前記コンピュータに記憶されている文字コードの特徴とを比較して前記データを記述している文字コードを特定する文字コード解析手段、
前記文字コード解析手段で特定された文字コードで記述されている前記データが前記コンピュータのオペレーティングシステムで使用されている文字コードで記述されるように前記データの文字コードを変換する文字コード変換手段、
前記文字コード変換手段で文字コードを変換されたデータを解析して不要な文字列を削除するデータ解析手段として機能させるための文字コード変換用プログラム。
A character code conversion program for adapting a character code describing the data to a computer operating system before reading the data described in the file into a program operating on the computer,
Character code analysis means for identifying the character code describing the data by comparing the characteristics of the character code describing the data with the characteristics of the character code stored in the computer in advance.
Character code conversion means for converting the character code of the data so that the data described by the character code specified by the character code analysis means is described by the character code used in the operating system of the computer;
A program for character code conversion for functioning as data analysis means for analyzing data converted by the character code conversion means and deleting unnecessary character strings.
JP2004110704A 2004-04-05 2004-04-05 Character code conversion method, computer with character code conversion function and character code conversion program Pending JP2005293440A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004110704A JP2005293440A (en) 2004-04-05 2004-04-05 Character code conversion method, computer with character code conversion function and character code conversion program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004110704A JP2005293440A (en) 2004-04-05 2004-04-05 Character code conversion method, computer with character code conversion function and character code conversion program

Publications (1)

Publication Number Publication Date
JP2005293440A true JP2005293440A (en) 2005-10-20

Family

ID=35326270

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004110704A Pending JP2005293440A (en) 2004-04-05 2004-04-05 Character code conversion method, computer with character code conversion function and character code conversion program

Country Status (1)

Country Link
JP (1) JP2005293440A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010176237A (en) * 2009-01-28 2010-08-12 Nec Corp System, method and program for automatically discriminating character code

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010176237A (en) * 2009-01-28 2010-08-12 Nec Corp System, method and program for automatically discriminating character code

Similar Documents

Publication Publication Date Title
JP4924976B2 (en) Software development support system
EP2390793B1 (en) Method for determining similarity of text portions
CN113378525A (en) PDF document paragraph presentation method, device, storage medium and equipment
JP7163845B2 (en) Information processing device and program
JP2005293440A (en) Character code conversion method, computer with character code conversion function and character code conversion program
JPS62241026A (en) Character string retrieving system
US7523031B1 (en) Information processing apparatus and method capable of processing plurality type of input information
US20040205666A1 (en) System and method for anticipated file editing
JPH0660136A (en) Drawing edit device
CN113157793B (en) ETL file splitting method and device
JPH1021192A (en) Operation extraction system and macro generation system
JP2720770B2 (en) Automatic post-processing method
JP2727975B2 (en) Handwritten symbol recognition system
JPH0554177A (en) Character recognition device
JPH0675958A (en) Document processor
JP2000181691A (en) Program structure analysis system
JP2838972B2 (en) Automatic indexing device
JPH07219946A (en) Document creation device
JPH06251187A (en) Method and device for correcting character recognition error
CN116954701A (en) Binary detection method and system based on blood-edge relation
JPH11161666A (en) Document data search method and apparatus, and document editing apparatus
US6321223B1 (en) Method of identifying multilingual text for DOS
JP2798058B2 (en) File reading command generation processing system and file reading processing method
JPH08297579A (en) Delimiter processing method in text data
JP2012068946A (en) Batch processing program analyzing method and device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070313

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090414

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090804