The data that can be stored depends on the codeset of the database server. All characters of the codeset (that is, code page) can be stored in the columns, but a character that does not belong to the codeset cannot be stored in the columns. The only difference between the CHAR/VARCHAR and the NCHAR/NVARCHAR columns is that comparison operations for CHAR/VARCHAR columns are done using codeset value (numeric comparison), whereas the comparison operations for NCHAR/NVARCHAR columns uses locale/language semantics.
On Unix, the default code set for the database server is ISO8859-1; on Windows, the default code set is Windows 1252. The codeset of the database server can be specified at install time, or it can be changed by setting the environment variable GL_LOCALE.
Informix manuals have instructions to set the correct locale, but examples follow:
-
To set locale for U.S. English, ISO8859-1:
-
set GL_LOCALE to en_us.8859-1
-
To set locale for U.S. English, Windows 1252:
-
set GL_LOCALE to en_us.1252
To determine the current codeset for a server, use the following query:
select site from systables where tabname = ' GL_COLLATE'