Conversions and Changes to Data Lengths

In some cases, converting data between the server’s character set and the client’s character set results in a change to the length of the data. For example, when the character set on one system uses one byte to represent each character and the character set on the other system requires two bytes per character.

When character set conversion results in a change in data length, there are two possibilities:
To configure your system or application:
  1. Configure the server to use Unicode conversions. If the data length increases between the server and the client, you must also complete steps 2 and 3.
  2. The client must be using Open Client 11.1 or later. It must inform the server that it can handle CS_LONGCHAR data at connection time, using the Open Client ct_capability function.
    The capability parameter must be set to CS_DATA_LCHAR and the value parameter must be set to CS_TRUE, where connection is a pointer to a CS_CONNECTION structure:
    CS_INT capval = CS_TRUE
  3. When conversions result in an increase in data length, char and varchar data are converted to the client’s character set and are sent to the client as CS_LONGCHAR data. The client application must be coded to extract the data received as CS_LONGCHAR.