def guess_encoding(text, default=DEFAULT_ENCODING):
result = chardet.detect(text)<EOL>return normalize_result(result, default=default)<EOL>
Guess string encoding.

    Given a piece of text, apply character encoding detection to
    guess the appropriate encoding of the text.