Skip to content

NVARCHAR2 support with non utf-8 database encoding #533

Closed
@wilkolazki

Description

@wilkolazki

We have an Oracle database which is running for many years now.
The db was set up with NLS_CHARACTERSET EE8ISO8859P2. Migration to AL32UTF8 is not possible due to incompatible ERP software.
We need to store some Unicode data, so we created a test table with NVARCHAR2 column. NLS_NCHAR_CHARACTERSET is AL16UTF16.

With SQLPlus we have inserted some test polish and russian text in the nvarchar2 column and we can select it correctly.
When selected with node oracledb, the result is malformed, any character which cannot be represented in the iso-8859-2 set is replaced by question mark.

Answer the following questions:

  1. What error(s) you are seeing?

The nvarchar2 column contains following text:

По́йдзьце о дзятки, по́йдзьце вшистке разэм
За място, подъ слупъ на взго́рэкъ,
Тамъ пр̌едъ цудовнымъ клęкнийце образэмъ,
Побожне змо́вце пацёрэкъ.

Po polsku po polsku po polsku.
zażółć gęślą jaźń

Ă, Â, Î, Ș, Ț

After selecting:
SELECT nvchar_column FROM nvchar_table;

'????????? ? ??????, ????????? ??????? ?????\n?? ?????, ???? ????? ?? ?????????,\n???? ?????? ????????? ??ę?????? ????????,\n??????? ??????? ????????.\n \nPo polsku po polsku po polsku.\nzażółć gęślą jaźń\n\nĂ, Â, Î, ?, ?'

  1. What environment variables did you set? How exactly did you set them?

NLS_LANG=POLISH_POLAND.AL32UTF8

  1. What is your version of Node.js?
    v.4.4.4
  2. What is your version of the Oracle client (e.g. Instant Client)? How was it installed? Where it is installed?
    1.11.0 installed locally with npm install.
  3. What is your OS and version?
    Linux domx1st 3.2.0-4-amd64 Make node-oracledb installable via standard 'npm' install #1 SMP Debian 3.2.78-1 x86_64 GNU/Linux
  4. What compiler version did you use?
    I assume that the gyp used:
    $ cpp --version
    cpp (Debian 4.7.2-5) 4.7.2

What do we need to change to turn on support for nvarchar2 values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions