(ls)
Compresses the given list of (unicode) strings by storing each string
    (except the first one) as an integer (encoded in a byte) representing
    the prefix it shares with its predecessor, followed by the suffix encoded
    as UTF-8.
Compresses the given list of (unicode) strings by storing each string
    (except the first one) as an integer (encoded in a byte) representing
    the prefix it shares with its predecessor, followed by the suffix encoded
    as UTF-8.
Compresses the given list of ( unicode ) strings by storing each string ( except the first one ) as an integer ( encoded in a byte ) representing the prefix it shares with its predecessor followed by the suffix encoded as UTF - 8 .
def prefix_encode_all(ls):
    """Compresses the given list of (unicode) strings by storing each string
    (except the first one) as an integer (encoded in a byte) representing
    the prefix it shares with its predecessor, followed by the suffix encoded
    as UTF-8.
    """

    last = u('')
    for w in ls:
        i = first_diff(last, w)
        yield chr(i) + w[i:].encode("utf-8")
        last = w
def prefix_encode_all ( ls ) : last = u ( '' ) for w in ls : i = first_diff ( last , w ) yield chr ( i ) + w [ i : ] . encode ( "utf-8" ) last = w