Fixed #22 by trying to autodetect file encoding