zendframework/zf2 — pull request #6033 by hschletz (2014-03-24 12:12:03+00:00)
Title: Fixed charset support for Pdo_Pgsql.

Starting with Release 2.3, the "charset" option is passed to PDO. This is not supported for all PDO drivers. In particular, The pgsql driver throws an exception if the DSN contains the "charset" option.

I created a workaround for Pdo_Pgsql. Please note that the quoting of $charset is not 100% secure if the charset is not already set. Either set the encoding to a default charset before setting the final charset, validate the string to be plain ASCII, or document that the value cannot be trusted in regards to possible SQL injection.

For uniform charset handling, other drivers (PDO and non-PDO) may need special treatment as well.