autodetection of file encoding