summaryrefslogtreecommitdiff
path: root/rt/lib
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2019-03-03 19:26:41 -0500
committerMitch Jackson <mitch@freeside.biz>2019-03-03 19:49:20 -0500
commit70e31cdfd01949235897035ad818e9a7b2d0c958 (patch)
tree0ca8255c7542c4ca10c5379f1dea98cf2df2ffc8 /rt/lib
parentba4c2792eb0c8b828fdef637be6c11bd5d5176ca (diff)
RT# 82942 Force UTF8 client_encoding for Pg in RT::Handle
Diffstat (limited to 'rt/lib')
-rw-r--r--rt/lib/RT/Handle.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm
index f0bce38..35d218c 100644
--- a/rt/lib/RT/Handle.pm
+++ b/rt/lib/RT/Handle.pm
@@ -138,6 +138,11 @@ sub Connect {
($version) = $version =~ /^(\d+\.\d+)/;
$self->dbh->{pg_server_prepare} = 0 if $version > 9.1; #and we're using a deb-7 version DBD::Pg?
$self->dbh->do("SET bytea_output = 'escape'") if $version >= 9.0;
+
+ # Force UTF8, even when database encoding is not UTF8
+ # DBD::Pg used to do this for us prior to v3
+ $self->dbh->do('SET client_encoding TO UTF8;');
+ $self->dbh->{pg_enable_utf8} = -1;
}