def read(path, encoding="utf-8"):
    """Auto-decoding string reader.

    Usage::

        >>> from angora.dataIO import textfile
        or
        >>> from angora.dataIO import *
        >>> textfile.read("test.txt")
    """
    with open(path, "rb") as f:
        content = f.read()
        try:
            text = content.decode(encoding)
        except:
            res = chardet.detect(content)
            text = content.decode(res["encoding"])
    return text
Auto-decoding string reader.

    Usage::

        >>> from angora.dataIO import textfile
        or
        >>> from angora.dataIO import *
        >>> textfile.read("test.txt")