Fix encoding related bugs.

In particular, force our prefered encoding in the connection rather than
rely on whatever the server setup is: we know babel can handle utf8.
Merge pull request #5 from dimitri/master

Fix encoding related bugs.