Cnvtool Command Syntax

The cnvtool utility creates a C++ file which contains the character set conversion data (in an SCnvConversionData struct) and optionally a function returning the replacement for unconvertible Unicode characters. Both are used in a Charconv plug-in DLL.

Descriptions

The input to cnvtool are two text files which are known as the source file and the control file. The source file contains a table of pairs of hexadecimal numbers. The first number in each pair is the encoding of a character in the foreign character set, and the second is the Unicode encoding of the same character. The control file specifies the conversion algorithms to convert (both ways) between ranges of characters, and other information.

The SCnvConversionData data structure and the optional function generated by the tool can be accessed from hand-written C++ code.

The cnvtool -generated C++ file is compiled along with the hand-written C++ file to create a Charconv plug-in DLL.

Syntax

Invocation syntax

cnvtool -generateSourceCode control-file source-file output-file [options]

Arguments

-generateSourceCode

This must be specified.

control-file

The filename of the control file.

source-file

The filename of the source text file.

output-file

The filename of the generated cpp file.

[options]

See table below.

Optional arguments

The optional arguments may be positioned anywhere in the parameter list. Each has a short and a long form, as shown in the table below separated by a '|'.

-c | -columns (number-of-columns: column-of-foreign-character-set-codes, column-of-Unicode-codes)

This must be used if the source file consists of a non-standard number of columns, or if the columns are in a non-standard order. 1 (rather than 0) is the first column. If this flag is not used, then -columns(2: 1, 2) is assumed.

-r | -omitReplacementForUnconvertibleUnicodeCharacters

This must be specified if the replacement for unconvertible Unicode characters specified in the control file is not going to be used by the plug-in DLL.

-p | -cutOutAnyPrivateUseUnicodeCharacterSlotsBeingUsed

If this is not used and one or more private-use Unicode character slots are being used, a warning is generated.

-u | -sourceFilesToSubtract (source-file-1, source-file-2, ...)

This is for use when only a subset of the source file is to be used; the conversion pairs contained in the source files listed under this flag being subtracted from the conversion pairs obtained from the actual source file.