idb-connector - charset / german special chars


(jogi) #1

i run a testscript that sends an ‘wrksyssts’ via idb-connector to our ibm i.
the js-script has the ccsid 819.
if i run the script, the special chars are broken.

Größe -> Größe

const idb = require('idb-connector'),
  {dbconn, dbstmt, IN, OUT, CHAR, CLOB} = idb;
const sql = "CALL QXMLSERV.iPLUG512K(?,?,?,?)";
const connection = new dbconn();
connection.conn("*LOCAL");
const statement = new dbstmt(connection);

const ipc = "*NA";
const ctl = "*here";
const xmlIn = "<xmlservice><sh>system 'wrksyssts'</sh></xmlservice>";
const xmlOut = "";

statement.prepare(sql, () => {
  statement.bindParam([
    [ipc, IN, CHAR],
    [ctl, IN, CHAR],
    [xmlIn, IN, CLOB],
    [xmlOut, OUT, CLOB]
  ], () => {
    statement.execute((out) => { // 'out' is an array of output params
      for(let i = 0; i < out.length; i++)
        console.log( out[i] );
      statement.close();
      connection.disconn();
      connection.close();
    });
  });
});

Has somebody an idea whats going wrong ?


(Frédéric Harper) #2

It is a super-specific question so unfortunately I can’t help, but I would suggest you to create an issue in the repository of idb-connector: they’ll probably be able to help!