Datatypes and capabilities

To send and receive 2-byte characters, the client specifies its preferred byte order during the login phase of the connection. Any necessary byte-swapping is performed on the server side.

The Open Client ct_capability() parameters are as follows:

To access 2-byte character data, Open Client and Open Server implements the following:

Setting the CS_DATAFMT parameter’s datatype to CS_UNITEXT_TYPE allows you to use existing API calls, such as ct_bind, ct_describe, ct_param, ct_setparam, cs_convert and so on.

Since CS_UNITEXT is encoded as a UTF-16 Unicode datatype and stored in the 2-byte format, it can be used anywhere CS_TEXT is used. The maximum length of the CS_UNITEXT string parameter is half of the maximum length of CS_TEXT.

Like CS_TEXT, CS_UNITEXT uses CS_DATAFMT to describe the destination format. The symbols and meanings of the format field values are as follows:

Table 2-9: CS_DATAFMT structure

Bitmask field

Description

CS_FMT_NULLTERM

The data is 2-byte Unicode null-terminated (0x0000).

CS_FMT_PADBLANK

The data is padded with 2-byte Unicode blanks to the full length of the destination variable (0x0020).

CS_FMT_PADNULL

The data is padded with 2-byte Unicode nulls to the full length of the destination variable (0x0000).

CS_FMT_UNUSED

No format information is provided.