简体   繁体   中英

How to set connection charset using node-oracledb

I am trying to connect to Oracle database from node.js.

I have successfully installed the node-oracledb driver. I can connect to my Oracle database using the TNSNAMES file.

The problem is, my database is using NLS_CHARACTERSET EE8ISO8859P2 character set. In php applications I can change that to use UTF-8 while calling oci_pconnect.

Is there a way to do the same with node driver?

The answer is: I AM AN IDIOT!

Everything with Oracle and oracle driver is OK. I was using a replacement laptop and my putty was not set correctly. I was testing node oracle dirver with TRANSLATION option in putty set to ISO-8859-2 while the linux server was using UTF-8.

So the charset was malformed during the ssh transmision to my windows laptop :-(

From version 1.0, node-oracledb now always sets the "client" character set to Oracle's AL32UTF8 character set. Not that this would help with your putty issue!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM