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.

0 CCSID
1 IBM® i-supported CCSID
2 Short text description
3 AIX® 3.1
4 AIX 4.1
5 Windows® 3.1
6 Windows 95
7 Windows NT®
8 OS/2® Version 3
9 OS/2 Version 4
10 MVS™ description
11 IANA string
12 Developer Kit for Java™
13 System i™ default Java encoding

OutType
INPUT

Type of descriptor requested.

0 CCSID
1 IBM i-supported CCSID
2 Short text description
3 AIX 3.1
4 AIX 4.1
5 Windows 3.1
6 Windows 95
7 Windows NT
8 OS/2 Version 3
9 OS/2 Version 4
10 MVS description
11 IANA string
12 Developer Kit for Java
13 System i default Java encoding

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

Descriptor type String returned
CCSID 00037
IBM i-supported CCSID 00037
Short text description COM_EUROPE_EBCDIC
AIX 3.1 IBM-037
AIX 4.1 IBM-037
Windows 3.1 CP00037
Windows 95 *
Windows NT *
OS/2 Version 3 *
OS/2 Version 4 *
MVS description IBM-037
IANA string IBM037
Developer Kit for Java Cp037
System i default Java encoding ISO8859_1

Table 2. Sample Information from the API for CCSID 00932

Descriptor type String returned
CCSID 00932
IBM i-supported CCSID 00932
Short text description JAPAN_MIX_PC-DATA
AIX 3.1 IBM-932
AIX 4.1 IBM-932
Windows 3.1 *
Windows 95 *
Windows NT *
OS/2 Version 3 CP00932
OS/2 Version 4 CP00932
MVS description *
IANA string *
Developer Kit for Java *
System i default Java encoding SJIS

Table 3. Sample Information from the API for CCSID 00437

Descriptor type String returned
CCSID 00437
IBM i-supported CCSID 00437
Short text description USA_PC-DATA
AIX 3.1 IBM-437
AIX 4.1 IBM-437
Windows 3.1 CP00437
Windows 95 CP00437
Windows NT CP00437
OS/2 Version 3 CP00437
OS/2 Version 4 CP00437
MVS description *
IANA string IBM437
Developer Kit for Java Cp437
System i default Java encoding ISO8859_1

Table 4. Sample Information from the API for CCSID 01252

Descriptor type String returned
CCSID 01252
IBM i-supported CCSID 01252
Short text description MS-WIN_LATIN-1
AIX 3.1 *
AIX 4.1 *
Windows 3.1 CP01252
Windows 95 CP01252
Windows NT CP01252
OS/2 Version 3 CP01252
OS/2 Version 4 CP01252
MVS description *
IANA string Windows-1252
Developer Kit for Java Cp1252
System i default Java encoding ISO8859_1


API introduced: V4R3

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