Opened 19 years ago
Closed 19 years ago
#2215 closed enhancement (wontfix)
[patch] django.utils.html.escape does not escape non-english characters properly
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Tools | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This patch makes django.utils.html.escape use pythons htmlentitydefs module to know what to escape.
Characters like æ, ø, å and alot of other non-english letters are escaped properly:
>>> from django.utils.html import escape >>> escape('<p>æøå</p>') '<p>æøå</p>'
It would be nice to use generators here, but alas.
Attachments (1)
Change History (3)
by , 19 years ago
Attachment: | django-escape.diff added |
---|
comment:1 by , 19 years ago
Summary: | [patch] django.utils.html.escape does not escape non-english characers properly → [patch] django.utils.html.escape does not escape non-english characters properly |
---|
comment:2 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Entities don't need to be "escaped" to be used in HTML as long as you've got the right encoding. This might be worth added as a seperate filter, but it doesn't belong in
escape
.