def decode(data, true_char):
    """Decode a binary string with special true char to decimal"""
    encode = lambda x: "1" if x == true_char else "0"
    binary = "".join(encode(x) for x in data)
    return int(binary, 2)