Catch encoding errors and force utf8 encoding