Fix encoding issue with table engine