#NEWLINE# @ register . filter #NEWLINE# def display_url( url ) : #NEWLINE# #INDENT# 'Display a URL like the browser URL bar would.\n\n    Note: returns a Unicode object, not a valid URL.\n    ' #NEWLINE# if isinstance ( url , unicode ) : #NEWLINE# #INDENT# url = url . encode ( 'utf8' ) #NEWLINE# #UNINDENT# bytes = urllib . unquote ( url ) #NEWLINE# c = chardet . detect ( c ) #NEWLINE# return bytes . decode ( c [ 'encoding' ] , 'replace' )