force utf-8 encoding on connect
This commit is contained in:
parent
2e66497511
commit
4c254e8edf
@ -61,6 +61,7 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
|
|||||||
params.push("host=" + this.getDomainSocketName());
|
params.push("host=" + this.getDomainSocketName());
|
||||||
return cb(null, params.join(' '));
|
return cb(null, params.join(' '));
|
||||||
}
|
}
|
||||||
|
params.push("options=--client_encoding='utf-8'");
|
||||||
dns.lookup(this.host, function(err, address) {
|
dns.lookup(this.host, function(err, address) {
|
||||||
if(err) return cb(err, null);
|
if(err) return cb(err, null);
|
||||||
params.push("hostaddr=" + address);
|
params.push("hostaddr=" + address);
|
||||||
|
@ -116,6 +116,8 @@ p.startup = function(config) {
|
|||||||
.addCString(config.user)
|
.addCString(config.user)
|
||||||
.addCString('database')
|
.addCString('database')
|
||||||
.addCString(config.database)
|
.addCString(config.database)
|
||||||
|
.addCString('options')
|
||||||
|
.addCString("--client_encoding='utf-8'")
|
||||||
.addCString('').flush();
|
.addCString('').flush();
|
||||||
//this message is sent without a code
|
//this message is sent without a code
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ test("sends startup message", function() {
|
|||||||
.addCString('brian')
|
.addCString('brian')
|
||||||
.addCString('database')
|
.addCString('database')
|
||||||
.addCString('bang')
|
.addCString('bang')
|
||||||
|
.addCString('options')
|
||||||
|
.addCString("--client_encoding='utf-8'")
|
||||||
.addCString('').join(true))
|
.addCString('').join(true))
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user