def serialize_and_encode(value: Any) -> Tuple[str, bytes, int]:
    """
    Serialize a value to a JSON string and encode it to UTF-16 bytes for
    storage calculations.
    """
    serialized_val = json.dumps(value)
    # Azure Table Storage checks sizes against UTF-16-encoded bytes
    bytes_val = serialized_val.encode("utf-16", errors="ignore")
    val_length = len(bytes_val)
    return serialized_val, bytes_val, val_length

    Serialize a value to a JSON string and encode it to UTF-16 bytes for
    storage calculations.
    
llama-index-utils/llama-index-utils-azure/llama_index/utils/azure/table.py