summaryrefslogtreecommitdiff
path: root/django/utils/encoding.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/encoding.py')
-rw-r--r--django/utils/encoding.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py
index 7466e02300..5bb23a28bf 100644
--- a/django/utils/encoding.py
+++ b/django/utils/encoding.py
@@ -66,5 +66,8 @@ def iri_to_uri(iri):
Returns an ASCII string containing the encoded result.
"""
- return urllib.quote(smart_str(iri), safe='/#%[]')
+ # The list of safe characters here is constructed from the printable ASCII
+ # characters that are not explicitly excluded by the list at the end of
+ # section 3.1 of RFC 3987.
+ return urllib.quote(smart_str(iri), safe='/#%[]=:;$&()+,!?')