def json_utf8_encode(obj: object) -> object:
    """Binary encode all strings in an object.

    :arg obj: Object.

    :returns: Object with binary encoded strings.
    """
    if isinstance(obj, str):
        return obj.encode('utf-8')
    if isinstance(obj, list) or isinstance(obj, tuple):
        return [json_utf8_encode(item) for item in obj]
    return obj