git.iko.soy/typeable/postgresql-simple
on master help sign in
On connection initialization, SET client_encoding TO UTF8

In preparation for the pure escaping routines discussed in #120

commita188a1178d4acd9c6414394040e8c6c3b5c74c46 authorLeon P Smith <leon@melding-monads.com> dateMon 11 May 2015, 18:10 (11 years ago) parent28349b2
1 file changed+2−2
src/Database/PostgreSQL/Simple/Internal.hs+2−2
src/Database/PostgreSQL/Simple/Internal.hs+2−2
@@ -225,8 +225,8 @@ connectPostgreSQL connstr = do
225225 let wconn = Connection{..}
226226 version <- PQ.serverVersion conn
227227 let settings
228− | version < 80200 = "SET datestyle TO ISO"
229− | otherwise = "SET standard_conforming_strings TO on;SET datestyle TO ISO"
228+ | version < 80200 = "SET datestyle TO ISO;SET client_encoding TO UTF8"
229+ | otherwise = "SET datestyle TO ISO;SET client_encoding TO UTF8;SET standard_conforming_strings TO on"
230230 _ <- execute_ wconn settings
231231 return wconn
232232 _ -> do