Skip to content

Commit 4eb99e0

Browse files
committed
Explicitly set client encoding
Postgres will translate data from non-utf8 databases for us
1 parent a17fe64 commit 4eb99e0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ impl PostgresConnection {
173173
next_stmt_id: Cell::new(0)
174174
};
175175
176+
args.push((~"client_encoding", ~"UTF8"));
176177
// We have to clone here since we need the user again for auth
177178
args.push((~"user", user.user.clone()));
178179
if !path.is_empty() {
@@ -788,7 +789,7 @@ impl RowIndex for uint {
788789
}
789790
}
790791
791-
// This is a convenicence as the 0 in get[0] resolves to int :(
792+
// This is a convenience as the 0 in get[0] resolves to int :(
792793
impl RowIndex for int {
793794
fn idx(&self, _stmt: &NormalPostgresStatement) -> uint {
794795
assert!(*self >= 0);

0 commit comments

Comments
 (0)