encoding: implemented ngram-based encoding/language detector