Multibyte characters with NCHAR

To store multibyte character data in an NCHAR column, your database locale must support a code set that includes the same multibyte characters.

When you store multibyte characters, make sure to calculate the number of bytes that are needed. The size parameter of the NCHAR data type refers to the number of bytes of storage that is reserved for the data, rather than to the number of logical characters.

HCL Informix® supports the SQL_LOGICAL_CHAR configuration parameter, which can enable logical-character semantics in the declarations of NCHAR and other built-in character data types. For more information, see Data definition statements.

Because one multibyte character requires several bytes for storage, the value of size bytes does not indicate the number of characters that the column can hold. The total number of multibyte characters that you can store in the column is less than the total number of bytes that you can store in the column. Make sure to declare the size value of the NCHAR column in such a way that it can hold enough characters for your purposes.