mscdex / esqlite

An SQLite binding for node.js with built-in encryption, focused on simplicity and (async) performance
MIT License
37 stars 1 forks source link

Registering Japanese characters in a database table column does not work. #2

Closed ryusei-48 closed 1 year ago

ryusei-48 commented 1 year ago

The registration process itself can be performed, but when the string inserted into the record is checked, it is cut off in the middle and only part of the string is there, or blank characters are inserted. There are also garbled characters. This is probably an internal character code processing problem.

db.query(`CREATE TABLE tags ( name TEXT NOT NULL )`);
db.query(`INSERT INTO tags( name ) VALUES( ? )`, ["あいうえお"]);
db.query(`INSERT INTO tags( name ) VALUES( ? )`, ["テスト"]);
db.query(`INSERT INTO tags( name ) VALUES( ? )`, ["text test"]);
db.query(`SELECT * FROM tags`, ( _, rows ) => { console.dir(rows, { deps: null }) });

output example

[
  { name: 'テ' },
  { name: 'あ�' },
  { name: 'text test' },
]