Add encoding check for utf-8