#35280 closed Bug (fixed)
iriencode example incorrect
Reported by: | minusf | Owned by: | Can Huynh |
---|---|---|---|
Component: | Documentation | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#iriencode
If value is "?test=1&me=2", the output will be "?test=1&me=2".
This is not the case as by default "&" is a safe character for iriencode: https://github.com/django/django/blob/main/django/utils/encoding.py#L135.
It is urlencode that does that conversion. iriencode is more for non-ascii characters in my understanding, and using both at the same time is supported:
value|urlencode|iriencode
Change History (9)
comment:1 by , 8 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 8 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 8 months ago
Thank you! Preparing the patch now.
Replying to minusf:
there is no monopoly on pull requests, go ahead Can :D
comment:7 by , 8 months ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Good catch, we could use an example from the docstring,
'/I ♥ Django/
. Would you like to prepare a patch?