From: Mitch Jackson Date: Mon, 4 Mar 2019 00:26:41 +0000 (-0500) Subject: RT# 82942 Force UTF8 client_encoding for Pg in RT::Handle X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=70e31cdfd01949235897035ad818e9a7b2d0c958 RT# 82942 Force UTF8 client_encoding for Pg in RT::Handle --- diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm index f0bce38c1..35d218c1d 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; }