Generic decoding with length check. The string is decoded from bytes with the given encoding, then the length of the string is checked. The string is decoded using the "replace" method. :param data: bytes :param encoding: encoding name ("utf-8" or "u
(data, encoding, str_len)