Fixing issue with bad encoding being set on MySQL