def encode_strings(items):
    """Encode a sequence of strings into a binary blob
    with zero terminated bytes and a list with offsets
    into this blob.
    """
    blob = bytearray()
    offsets = []
    for item in items:
        offset = len(blob)
        data = item.encode("utf8") + bytes([0])

        blob.extend(data)
        offsets.append(offset)

    return blob, offsets