Configuring DB2 for Unicode

Edit the application assignment file and database configuration files to configure the DB2 connector for Unicode.

  1. To maximize Unicode capabilities:
    1. Use a Unicode database (except for iSeries).
    2. In the application assignment file, set $DEF_CHARSET to UTF8.
  2. To enable limited Unicode support for a non-Unicode database:
    1. To enable Unicode only in fields that use a W packing code, set $DEF_CHARSET to the code page used by the database.
    2. To enable Unicode in fields that use either W or C packing codes, set $DEF_CHARSET to UTF8.
    3. On Windows and Unix set the alt_collate configuration parameter using one of the following commands, then stop and restart the database for the parameter to take effect:
      update db cfg using alt_collate identity_16bit 
      update db cfg using alt_collate uca400_no
      update db cfg using alt_collate uca400_lth

      The alt_collate makes it possible for Uniface to add CCSID UNICODE to the table definitions. Otherwise, using the W packing code or setting $DEF_CHARSET to UTF8 will result in the following error:

      SQL0622N The clause "CCSID UNICODE" is invalid for this database. SQLSTATE=56031

  3. To disable Unicode completely, in the application assignment file, set the unicode connector option off:
    USYS$DB2_PARAMS unicode = off

Related Topics