diff --git a/index.d.ts b/index.d.ts index 2e626cc..99b8800 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2,7 +2,7 @@ // Project: node-firebird // Definitions by: Marco Warm -declare module 'node-firebird' { +declare module 'node-firebird-dev' { type DatabaseCallback = (err: any, db: Database) => void; type TransactionCallback = (err: Options, transaction: Transaction) => void; diff --git a/lib/index.js b/lib/index.js index bd2078d..ee5cd87 100644 --- a/lib/index.js +++ b/lib/index.js @@ -796,7 +796,7 @@ exports.escape = function(value) { }; const - DEFAULT_ENCODING = 'utf8', + DEFAULT_ENCODING = 'latin1', DEFAULT_FETCHSIZE = 200; const @@ -3733,7 +3733,7 @@ Connection.prototype.attach = function (options, callback, db) { blr.pos = 0; blr.addByte(1); - blr.addString(isc_dpb_lc_ctype, 'UTF8', DEFAULT_ENCODING); + blr.addString(isc_dpb_lc_ctype, 'ISO8859_1', DEFAULT_ENCODING); blr.addString(isc_dpb_user_name, user, DEFAULT_ENCODING); blr.addString(isc_dpb_password, password, DEFAULT_ENCODING); @@ -3812,8 +3812,8 @@ Connection.prototype.createDatabase = function (options, callback) { blr.pos = 0; blr.addByte(1); - blr.addString(isc_dpb_set_db_charset, 'UTF8', DEFAULT_ENCODING); - blr.addString(isc_dpb_lc_ctype, 'UTF8', DEFAULT_ENCODING); + blr.addString(isc_dpb_set_db_charset, 'ISO8859_1', DEFAULT_ENCODING); + blr.addString(isc_dpb_lc_ctype, 'ISO8859_1', DEFAULT_ENCODING); blr.addString(isc_dpb_user_name, user, DEFAULT_ENCODING); blr.addString(isc_dpb_password, password, DEFAULT_ENCODING); @@ -4520,7 +4520,7 @@ Connection.prototype.svcattach = function (options, callback, svc) { blr.pos = 0; blr.addBytes([isc_dpb_version2, isc_dpb_version2]); - blr.addString(isc_dpb_lc_ctype, 'UTF8', DEFAULT_ENCODING); + blr.addString(isc_dpb_lc_ctype, 'ISO8859_1', DEFAULT_ENCODING); blr.addString(isc_dpb_user_name, user, DEFAULT_ENCODING); blr.addString(isc_dpb_password, password, DEFAULT_ENCODING); blr.addByte(isc_dpb_dummy_packet_interval); @@ -4636,7 +4636,7 @@ Connection.prototype.queEvents = function(events, eventid, callback) { // prepare EPB blr.addByte(EPB_version1); for (var event in events) { - var event_buffer = new Buffer(event, 'UTF8'); + var event_buffer = new Buffer(event, 'ISO8859_1'); blr.addByte(event_buffer.length); blr.addBytes(event_buffer); blr.addInt32(events[event]);