add tests for charset parameter on live connection

The charset parameter is only tested in the dsn parser.
Add tests on the database connection.
Fix charset handling in connection.