13. The system of claim 11 , further comprising: means for removing from the plurality of byte-n-grams every byte-n-gram in which all bytes have a value less than 127.
11. A system comprising: means for receiving a sequence of bytes representing text in a document; means for identifying a plurality of byte-n-grams occurring in the sequence of bytes, each byte-n-gram comprising n adjacent bytes from the sequence of bytes, where n is an integer greater than 1; means for identifying, for multiple encodings, a respective likelihood of each byte-n-gram occurring in each of the respective multiple encodings; means for receiving multiple likelihoods associated with a top-level-domain of the document, each of the multiple likelihoods indicating a likelihood that documents from the top level domain are in a respective one of the multiple encodings; means for determining a respective encoding score for each of the multiple encodings, each respective encoding score being based on the likelihood of the plurality of byte-n-grams occurring in the corresponding one of the multiple encodings and based on the likelihoods associated with the top-level-domain the corresponding one of the multiple encodings; and means for identifying a most likely encoding of the document based on a highest encoding score among the encoding scores.