fix detect utf-8 error