now detectFileEncoding can accept any file or url connections.