@classmethod
def _decode_payload(cls, octets, errors):
    """Called from Record._decode with the PAYLOAD of an NDEF Text
        Record. Returns a new TextRecord instance initialized with the
        decoded data fields. Raises ndef.DecodeError if any of the
        decoding steps failed. All decoding errors are handled 'strict'.

        """
    FLAG = cls._decode_struct('B', octets)
    if FLAG & 63 == 0:
        raise cls._decode_error('language code length can not be zero')
    if FLAG & 63 >= len(octets):
        raise cls._decode_error('language code length exceeds payload')
    UTFX = 'UTF-16' if FLAG >> 7 else 'UTF-8'
    LANG = octets[1:1 + (FLAG & 63)]
    try:
        TEXT = octets[1 + len(LANG):].decode(UTFX)
    except UnicodeDecodeError:
        raise cls._decode_error("can't be decoded as {}".format(UTFX))
    return cls(TEXT, LANG, UTFX)
