ConvertCodepage

The command ConvertCodepage copies a file and performs a code page conversion.

Syntax

ConvertCodepage
   Src(<text>)
   Dest(<text>)
   From(<text>)
   To(<text>)
   SubstituteChar(<text>)
   SubstituteCode(<number>)
   TimeOut(<number>);

Parameters

  • Src: Required. The file with content to be converted.
  • Dest: Required. The destination of the converted file.
  • From: Required. Code page in which the file Src is stored. See the table for special values.
  • To: Required. Code page to which the file Dest has to be converted. See the table in this section for special values.
  • SubstituteChar: Optional. Replacement character used if a character from the file Src could not be translated into the code page mentioned under To.
  • SubstituteCode: Optional. Numerical representation for the replacement character used if a character from Src could not be translated into the code page To.
  • TimeOut: Optional. The maximum amount of time in seconds the ConvertCodepage command waits for the client to report its code page if the client code page is specified as a From or To parameter. If this time is exceeded, the upload is aborted and an error is reported. If this parameter is omitted, KCM Core uses the default timeout interval as configured in KCM Core Administrator. A value of 0 disable the timeout. .

The parameters To and From specify the source and target code pages. These code pages can be one of the following values.

Value

Description

Source of translation table

"0"

Use the local Windows code page.

Uses Windows code page translation system.

"nnn"

Any number nnn: the number of the code page.

"client"

Query the remote client for its code page.

Client can either provide a full translation table or a code page number.

"local"

Use the local Windows code page.

Uses Windows code page translation system.

"unicode"

Use Unicode (UTF-16 encoding) in Intel 386 byte order (little endian).

"unicode-big-endian"

Use Unicode (UTF-16 encoding) in big endian byte order.

"windows"

Use the local Windows code page.

Uses Windows code page translation system.

If both To and From specify the same code page, KCM Core copies the Src file to Dest as if the command CopyFile is specified. Also, the code pages " 0," " local," and "windows" all perform the same translation using the local Windows code page. These aliases are provided for backward compatibility.

The command ConvertCodepage only supports translations for code pages that use a fixed-length character encoding. Code pages that use a variable-length encoding, such as MBCS SI/SO sequences or UTF-8, are not supported. The code page translations "unicode" and "unicode-big-endian" are limited to the UCS‑2 subset of UTF-16 (characters U+0000 .. U+FFFF). Characters in the supplementary planes are considered unmappable and replaced with the replacement character.

If the ConvertCodepage command is terminated due to a timeout, the connection to the KCM Core process is reset to ensure that data in transit is discarded and processes resynchronize correctly. This forced reset can result in additional network-related errors in the log for this job. Any further communication from this job between the Document Processor and the client fails. The client is informed that the Document Processor is disconnected.