4.11. Дополнительные параметры для настройки кодировок клиентов #

NLS_LANG #

По умолчанию ora2pgpro задаёт для NLS_LANG значение AMERICAN_AMERICA.AL32UTF8, а для NLS_NCHARAL32UTF8. Не рекомендуется изменять эти значения, но в некоторых случаях это может быть полезно. При изменении значений этой директивы кодировка клиента на стороне Oracle изменится с изменением значений переменных окружения $ENV{NLS_LANG} и $ENV{NLS_NCHAR}.

BINMODE #

По умолчанию ora2pgpro заставляет Perl использовать кодировку ввода-вывода UTF8 путём вызова прагмы Perl:

use open ':utf8';

Кодировку можно переопределить, задав директиву BINMODE: например, задайте значение :locale, чтобы использовать локаль системы, или iso-8859-7.

use open ':locale';
use open ':encoding(iso-8859-7)';

Если в NLS_LANG задана локаль, отличная от кодировки UTF8, можно дополнительно указать эту директиву. Для большинства случаев оставьте директиву закомментированной.

CLIENT_ENCODING #

Во избежание проблем кодировка клиента Postgres Pro автоматически указывается как UTF8. Если не используется значение NLS_LANG по умолчанию, может понадобиться изменить кодировку клиента Postgres Pro.

Список поддерживаемых Postgres Pro наборов символов описан в разделе Поддержка кодировок.

FORCE_PLSQL_ENCODING #

Включите эту директиву, чтобы использовать кодировку UTF8 для экспортируемого кода PL/SQL. Директива может быть полезна в особых случаях.

4.11. Special Options to Handle Character Encoding #

NLS_LANG #

By default, ora2pgpro will set NLS_LANG to AMERICAN_AMERICA.AL32UTF8 and NLS_NCHAR to AL32UTF8. It is not recommended to change those settings but in some case it could be useful. Using your own settings with those configuration directive will change the client encoding at Oracle side by setting the environment variables $ENV{NLS_LANG} and $ENV{NLS_NCHAR}.

BINMODE #

By default, ora2pgpro will force Perl to use UTF8 I/O encoding. This is done through a call to the Perl pragma:

use open ':utf8';

You can override this encoding by using the BINMODE directive, for example you can set it to :locale to use your locale or iso-8859-7.

use open ':locale';
use open ':encoding(iso-8859-7)';

If you have changed the NLS_LANG to non-UTF8 encoding, you might want to set this directive. Most of the time, leave this directive commented.

CLIENT_ENCODING #

By default, Postgres Pro client encoding is automatically set to UTF8 to avoid encoding issues. If you have changed the value of NLS_LANG, you might have to change the encoding of the Postgres Pro client.

For the Postgres Pro supported character sets, see Character Set Support.

FORCE_PLSQL_ENCODING #

To force UTF8 encoding of the PL/SQL code exported, enable this directive. Could be helpful in some rare condition.

FAQ