Convert a Graphic Character String (CDRCVRT, QTQCVRT) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Convert a Graphic Character String (CDRCVRT, QTQCVRT) API converts a graphic character data string of the identified string type (ST1) represented in a specified from CCSID (CCSID1) to a graphic character data string of the required string type (ST2) that is represented in another specified to CCSID (CCSID2).

The function assumes that the entire string to be converted is known and is passed to the function. Also, the caller has provided sufficient space for the returned converted string. In case of an overflow situation, an orderly truncation would result.

Authorities and Locks

None.


Required Parameter Group

CCSID1
INPUT; INT(4)

This variable contains the CCSID value for the input graphic character data string being converted. The valid range is 1 to 65,533.

ST1
INPUT; INT(4)

This variable contains the type of input string. The following types are defined:


S1
INPUT; CHAR(*)

This variable contains the graphic character data to be converted.

L1
INPUT; INT(4)

This variable contains the length (in number of bytes) of:

  • the string to be converted when ST1=0 or

  • the input buffer when ST1=1

The valid range is from 1 to 32,767.

CCSID2
INPUT; INT(4)

This variable contains the CCSID value for the converted graphic character data string. The valid range is 1 to 65,533.

ST2
INPUT; INT(4)

This variable contains the type of output string. The following types are defined:


GCCASN
INPUT; INT(4)

This variable contains a number that identifies which conversion alternative is to be selected to convert graphic character data from (CCSID1, ST1) to (CCSID2, ST2). Valid values are:

Notes:

  1. The values 0 and 1 are treated the same.

  2. Character Data Representation, SC09-1391, contains the CDRA-defined default conversion tables. This manual is not available online, but can be ordered from the IBM® Publications CenterLink outside information center.

L2
INPUT; INT(4)

This variable contains the byte-length of the allocated area to contain the converted graphic character data. The valid range is 1 to 32,767.

S2
OUTPUT; CHAR(*)

The converted graphic character data. The area's allocated length is given in L2.

Under certain error conditions the output may contain the results of converting only a part of the input string.

L3
OUTPUT; INT(4)

This variable contains the byte-length of the converted string returned in S2.

The byte-length includes any null termination or padding characters necessary to retain the semantics of CCSID2 and ST2.

L4
OUTPUT; INT(4)

The implementation of this API does not support the function of this parameter. This value is always returned as 0.

FB
OUTPUT; FEEDBACK

The function returns (in this feedback array) the processing status (and any associated reason) for this function; the field type is array of three 32-bit two's complement binary values (12 bytes, or 96 bits); the status code is a non-negative number in the first 16 bits, and the reason code is a non-negative number in the second 16 bits. The following are specific meanings of the status code and associated reason code values (in hexadecimal) contained in the first 32 bits of FB.


Feedback Codes and Conditions



Usage Notes

  1. Some of the above status and reason code values are possible only when the method selected and the tables used have the capabilities to indicate that a character replacement has occurred (using shadow flags or other equivalent means) or that a substitution with a SUB character was done.

  2. When CDRCVRT terminates with a feedback code indicating that the area allocated for output was insufficient, it is the responsibility of the caller to ensure that the remaining portion of the input string is semantically correct prior to making a subsequent call to complete the conversion. For example, in the case of input data with an encoding scheme of X'1301' (mixed host SB/DB encoding), an SI is added at the end of the truncated output string if required; however, no alteration is made to the input string. If a subsequent call is made with the remainder of the input string, the function terminates unsuccessfully and an SI is encountered without a leading SO.

  3. When the encoding associated with a CCSID is such that all graphic character code points are a fixed number of bytes (for example, two for pure double-byte), the assumption is that there are no characters (control or graphic) with a code point width different from that called for by the encoding scheme (other than the termination characters appropriate for the specified input string type) in the input string. The caller is responsible for filtering out any characters or sequences before calling the function.

API introduced: V2R2

[ Back to top | National Language Support APIs | APIs by category ]