From f9390dab6b623cf305492920ffd799682b00ba08 Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Sun, 16 Jul 2017 16:35:32 -0500 Subject: [PATCH] Re-implement changes from conflict --- lib/client.js | 4 ++-- lib/connection.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client.js b/lib/client.js index d0052604..107377c7 100644 --- a/lib/client.js +++ b/lib/client.js @@ -40,11 +40,11 @@ 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, + encoding: this.connectionParameters.client_encoding || 'utf8' }) this.queryQueue = [] this.binary = c.binary || defaults.binary - this.encoding = 'utf8' this.processID = null this.secretKey = null this.ssl = this.connectionParameters.ssl || false diff --git a/lib/connection.js b/lib/connection.js index 2f13803e..0f98cb06 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -25,7 +25,7 @@ var Connection = function (config) { this.lastOffset = 0 this.buffer = null this.offset = null - this.encoding = 'utf8' + this.encoding = config.encoding || 'utf8' this.parsedStatements = {} this.writer = new Writer() this.ssl = config.ssl || false