fix for server enconding when using SQL_ASCII and latin1 enconding

This commit is contained in:
Eder Ávila Prado 2017-06-20 17:22:29 -03:00 committed by Brian C
parent afe249896f
commit 860cccd531
2 changed files with 4 additions and 3 deletions

View File

@ -39,11 +39,12 @@ var Client = function(config) {
this.connection = c.connection || new Connection({
stream: c.stream,
ssl: this.connectionParameters.ssl,
keepAlive: c.keepAlive || false
keepAlive: c.keepAlive || false,
client_encoding: this.connectionParameters.client_encoding || 'utf8',
});
this.queryQueue = [];
this.binary = c.binary || defaults.binary;
this.encoding = 'utf8';
this.encoding = this.connectionParameters.client_encoding || 'utf8';
this.processID = null;
this.secretKey = null;
this.ssl = this.connectionParameters.ssl || false;

View File

@ -39,7 +39,7 @@ var Connection = function(config) {
this.lastOffset = 0;
this.buffer = null;
this.offset = null;
this.encoding = 'utf8';
this.encoding = config.client_encoding || 'utf8';
this.parsedStatements = {};
this.writer = new Writer();
this.ssl = config.ssl || false;