Configuring your system and application

If you are using UTF-8 anywhere in your client/server system, or using a Japanese character set, you are likely to encounter changes in data length as a result of character set conversion. You must configure your server to handle changes in data length. You may also need to set up your client to handle changes in data length.

  1. Configure the server to use Unicode conversions. See “Configuring the server”. 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
    ct_capability(connection,CS_SET,CS_CAP_RESPONS,
         CS_DATA_LCHAR,&capval)
    
  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.