auto detect text file encode and convert to utf8