Fixed SQL storing/retrieving in UTF-8

This will work if the charset is defined in the connection params and once sidorares accepts my pull request.