Examples
The following examples show how to set encoding for SJIS (Japanese).
- To set the environmental variable for SJIS, enter:
export NZ_ENCODING=SJIS
If you set the environment to a valid ICU converter name, it is used, otherwise it displays an error message and exits.
- To set the session for Japanese, enter:
set nz_encoding=sjis
The command sets the locale variable for the current session only.
- To set the locale for EUC-JP, enter:
export LC_CTYPE=japanese.eucjp
The command sets the locale variable.
When you start a Netezza Performance Server SQL session, the system checks your environment. The system checks the locale code set setting for the terminal window in which the nzsql command is invoked. To display the locale code set setting, use the Linux® command locale charmap.
You can always change the nz_encoding session variable value with an explicit SET command.
- If you set the encoding through the nzsql command,
you can use mixed case; that is,
SET nz_encoding=latin9
. - If you set the encoding at the UNIX shell
by using the environment variable, use uppercase for the variable
name; that is,
export NZ_ENCODING=LATIN9
. The name NZ_ENCODING must be in uppercase. The value Latin9 can be in mixed case.
To see all the data, the nz_encoding must be the same as the xterm display; that is, utf8 on a utf-8 xterm and latin9 on a latin9 or latin1 xterm. Netezza Performance Server SQL converts the output from a char or varchar column to utf-8 when the nz_encoding to set to utf8, and nchar or nvarchar columns to latin9 when nzencoding is set to latin9, substituting “?” if the conversion is not valid.