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());
|
||||
return cb(null, params.join(' '));
|
||||
}
|
||||
params.push("options=--client_encoding='utf-8'");
|
||||
dns.lookup(this.host, function(err, address) {
|
||||
if(err) return cb(err, null);
|
||||
params.push("hostaddr=" + address);
|
||||
|
@ -116,6 +116,8 @@ p.startup = function(config) {
|
||||
.addCString(config.user)
|
||||
.addCString('database')
|
||||
.addCString(config.database)
|
||||
.addCString('options')
|
||||
.addCString("--client_encoding='utf-8'")
|
||||
.addCString('').flush();
|
||||
//this message is sent without a code
|
||||
|
||||
|
@ -23,6 +23,8 @@ test("sends startup message", function() {
|
||||
.addCString('brian')
|
||||
.addCString('database')
|
||||
.addCString('bang')
|
||||
.addCString('options')
|
||||
.addCString("--client_encoding='utf-8'")
|
||||
.addCString('').join(true))
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user