gabordemooij/redbean — pull request #320 by Standfestgit (2013-11-18 11:53:38+00:00)
Title: Extended configuration

Added option $autoSetEncoding (defaults TRUE). If it is FALSE, PDO::setEncoding() would not be called.
This fixes the problem when some databases has text encoded in for example cp1251 but stored in utf8 fields and wre're unable to get readable text. ReadBean always set UTF8 encoding, therefore we're getting bad results (badly encoded and unreadable characters). I discovered that if I don't use function PDO::setEncoding, which actually do "SET names $encoding" then results are correct, mysql returns readable characters. Anyway, I really think, that user should have an option to disable "SET names" query.

So my change only ads ability to disable SET NAMES query. By default it is enabled.
I'll be glad to see that feature in Readbean php. No matter - my code implementation or yours! I really love that lib!