added auto-detect for utf-8