mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
unicode: Documented the new iriencode filter and added a test to prove one of
my claims. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0fc057c486
commit
d72f630fdb
@ -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
|
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.
|
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
|
join
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
@ -117,6 +117,8 @@ u'jack%20%26%20jill'
|
|||||||
u'1'
|
u'1'
|
||||||
>>> iriencode(u'S\xf8r-Tr\xf8ndelag')
|
>>> iriencode(u'S\xf8r-Tr\xf8ndelag')
|
||||||
u'S%C3%B8r-Tr%C3%B8ndelag'
|
u'S%C3%B8r-Tr%C3%B8ndelag'
|
||||||
|
>>> iriencode(urlencode(u'jack & jill'))
|
||||||
|
u'jack%20%26%20jill'
|
||||||
|
|
||||||
>>> urlizetrunc(u'http://short.com/', 20)
|
>>> urlizetrunc(u'http://short.com/', 20)
|
||||||
u'<a href="http://short.com/" rel="nofollow">http://short.com/</a>'
|
u'<a href="http://short.com/" rel="nofollow">http://short.com/</a>'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user