@register.filter(is_safe=True)
@stringfilter
def iriencode(value):
 return force_text(iri_to_uri(value))

@ register . filter ( is_safe = True ) @ stringfilter def iriencode ( value ) : return force_text ( iri_to_uri ( value ) )
escapes an iri value for use in a url .