QlgCvtTextDescToDesc()--Convert Text Descriptor API


  Syntax

  int QlgCvtTextDescToDesc(int  InType,
                           int  OutType,
                           char *InDescriptor,
                           int  InDescSize,
                           char *OutDescriptor,
                           int  OutDescSize,
                           int  JobCCSID);

  Service Program: QLGUSR

  Default Public Authority: *USE

  Threadsafe: Yes

The QlgCvtTextDescToDesc() function converts a descriptor of text from one type (CCSID, for example) to another type (IANA name, for example). (IANA is the Internet Assigned Number Authority.)

An example of a use of this support would be to convert an IANA name of ISO-8859-1 to an IBM® i CCSID of 819. For more information see the Usage Notes.


Authorities and Locks

API Public Authority
*USE

Parameters

InType
INPUT

Type of descriptor provided.


OutType
INPUT

Type of descriptor requested.


InDescriptor
INPUT

The input descriptor to be converted.

InDescSize
INPUT

The size (in bytes) of the descriptor to be converted.

OutDescriptor
OUTPUT

The converted descriptor.

OutDescSize
INPUT

The size (in bytes) of the out descriptor area.

JobCCSID
INPUT

The CCSID that the InDescriptor and OutDescriptor are encoded in. A value of zero means to use the job's default CCSID.


Return Value

>0
QlgCvtTextDescToDesc function was successful. The value returned in OutDescriptor is a pointer to a descriptor of the requested type. The value returned is the length (in bytes) of the returned descriptor.
<0
QlgCvtTextDescToDesc was not successful.

Error Conditions

If QlgCvtTextDescToDesc is not successful, the return value indicates one of the following errors:

-1
Qlg_InternalError1
QlgCvtTextDescToDesc function detected that an unknown resource failure occurred.

-2
Qlg_InternalError2
QlgCvtTextDescToDesc function detected that an internal table mismatch occurred.

-3
Qlg_BadInType
QlgCvtTextDescToDesc function detected that InType value was not recognized.

-4
Qlg_BadOutType
QlgCvtTextDescToDesc function detected that OutType value was not recognized.

-5
Qlg_InTypeEqualsOutType
QlgCvtTextDescToDesc function detected that he InType equals the OutType value.

-6
Qlg_CCSIDMapError
QlgCvtTextDescToDesc function detected that the OutDescriptor will equal the InDescriptor in this case.

-7
Qlg_BadCCSIDInDesc
QlgCvtTextDescToDesc function detected that the InDescriptor's CCSID is not a valid CCSID number.

-8
Qlg_JobCCSIDNotFound
QlgCvtTextDescToDesc function detected that the value for JobCCSID is not defined to the system.

-9
Qlg_BadJobCCSID
QlgCvtTextDescToDesc function detected that the value for JobCCSID is not a valid CCSID number.

-10
Qlg_InDescConvertFail
QlgCvtTextDescToDesc function detected that the value InDescriptor cannot be converted to CCSID 37.

-11
Qlg_InDescriptorNotFound
QlgCvtTextDescToDesc function detected that the value for InDescriptor is unknown.

-12
Qlg_OutTypeDescNotFound
QlgCvtTextDescToDesc function detected that the value for InDescriptor is known, but could not be related to the requested OutDescriptor.

-13
Qlg_OutDescSizeTooSmall
QlgCvtTextDescToDesc function detected that OutDescSize is too small to hold the requested OutDescriptor.

-14
Qlg_OutDescSizeExceedsMax
QlgCvtTextDescToDesc function detected that the OutDescriptor exceeds the maximum defined in the header file.

Usage Notes

The following is an example of the kind of information returned by this API for the possible choices. An asterisk (*) indicates that the descriptor is not supported for this CCSID.

Sample Information from the API for CCSID 00037

Table 2. Sample Information from the API for CCSID 00932

Table 3. Sample Information from the API for CCSID 00437

Table 4. Sample Information from the API for CCSID 01252



API introduced: V4R3

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