def METHOD_NAME(url):
    if url is None:
        return "<unknown>"
    if url[:5] == "data:":
        return "<data url>"
    url = truncatechars(url, MAX_URL_LENGTH)
    if isinstance(url, bytes):
        url = url.decode("utf-8", "replace")
    return url