Description
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:
- 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Ă, Â, Î, ?, ?'
- What environment variables did you set? How exactly did you set them?
NLS_LANG=POLISH_POLAND.AL32UTF8
- What is your version of Node.js?
v.4.4.4 - 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. - 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 - 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?