Modified fileencoding to guess