diff --git a/docs/templates.txt b/docs/templates.txt index 2f9f769b96..8fe4c82d43 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -1012,6 +1012,16 @@ right-most digit, 2 is the second-right-most digit, etc. Returns the original value for invalid input (if input or argument is not an integer, or if argument is less than 1). Otherwise, output is always an integer. +iriencode +~~~~~~~~~ + +Converts an IRI (Internationalized Resource Identifier) to a string that is +suitable for including in a URL. This is necessary if you are trying to use +strings containing non-ASCII characters in a URL. + +You can use this filter after you have used the ``urlencode`` filter on a +string, without harm. + join ~~~~ diff --git a/tests/regressiontests/defaultfilters/tests.py b/tests/regressiontests/defaultfilters/tests.py index fb35448edb..d2335dd87b 100644 --- a/tests/regressiontests/defaultfilters/tests.py +++ b/tests/regressiontests/defaultfilters/tests.py @@ -117,6 +117,8 @@ u'jack%20%26%20jill' u'1' >>> iriencode(u'S\xf8r-Tr\xf8ndelag') u'S%C3%B8r-Tr%C3%B8ndelag' +>>> iriencode(urlencode(u'jack & jill')) +u'jack%20%26%20jill' >>> urlizetrunc(u'http://short.com/', 20) u'http://short.com/'