summaryrefslogtreecommitdiff
path: root/lib/output/pq
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 23:11:37 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 23:11:37 +0100
commit634b05b9b97c7a481fca4e67285362c62dd4edfe (patch)
tree9917686376afedecd07a14fcd8dcc94ceca11277 /lib/output/pq
parentPerform source setup in transaction (diff)
downloadmygrate-634b05b9b97c7a481fca4e67285362c62dd4edfe.tar.bz2
mygrate-634b05b9b97c7a481fca4e67285362c62dd4edfe.tar.xz
mygrate-634b05b9b97c7a481fca4e67285362c62dd4edfe.zip
Set client char set no PQ connect
Diffstat (limited to 'lib/output/pq')
-rw-r--r--lib/output/pq/pqConn.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/output/pq/pqConn.cpp b/lib/output/pq/pqConn.cpp
index ba95cad..76a3a75 100644
--- a/lib/output/pq/pqConn.cpp
+++ b/lib/output/pq/pqConn.cpp
@@ -18,6 +18,7 @@ namespace MyGrate::Output::Pq {
PqConn::PqConn(const char * const str) : connstr {str}, conn {PQconnectdb(str), PQfinish}
{
verify<PqErr>(PQstatus(conn.get()) == CONNECTION_OK, "Connection failure", conn.get());
+ verify<PqErr>(!PQsetClientEncoding(conn.get(), "utf-8"), "Setting char set", conn.get());
PQsetNoticeProcessor(conn.get(), notice_processor, this);
}