http://www.perlmonks.org?node_id=1072816


in reply to Re^4: DBD::Pg encodes Perlstring to UTF-8 bytes instead of WIN1252 regardless client encoding
in thread DBD::Pg encodes Perlstring to UTF-8 bytes instead of WIN1252 regardless client encoding

therefore my strong guess that DBIx is logging what gets send to the database

As the author of DBIx::Log4perl I can guarantee you that DBIx::Log4perl gets any SQL passed to do/prepare before DBI and before DBD::Pg. You seemed to be suggesting that DBD::Pg was changing the encoding on strings and I'm simply saying if it did you would not see this from a DBIx::Log4perl log.

If you change the encoding of data passed to do/prepare I'd expect the log to change too so that doesn't tell us anything really.

Looking at the DBD::Pg code, if you don't enable pg_enable_utf8 then it doesn't seem to change any data to or from the database.

It seems like you are suggesting that when your client chrset is 1252 and you pass UTF8 to DBD::Pg then the data isn't right in the database? I wouldn't expect it to be since postgres thinks it is 1252 but you sent utf8.

If you have UTF8 encoded data then set your client chrset to utf8. If you want utf8 back then set pg_enable_utf8 - I didn't see a deprecated warning anywhere and I can assure you it is used all over the DBD::Pg code.