From 84d97beebed3fec7f8b5eaa2f6a17ae1279f2b72 Mon Sep 17 00:00:00 2001 From: farthestmage Date: Mon, 17 Nov 2025 19:10:18 +0530 Subject: [PATCH] Ticket 36737 Added escape for C1 ASCII --- django/utils/html.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/utils/html.py b/django/utils/html.py index 4751010062..167cf640a9 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -76,9 +76,9 @@ _js_escapes = { ord("\u2029"): "\\u2029", } -# Escape every ASCII character with a value less than 32 (C0) && 127-159(C1). -_js_escapes.update((ord("%c" % z), "\\u%04X" % z) for z in list(range(0x00, 0x20)) + list(range(0x80, 0xA0))) - +# Escape every ASCII character with a value less than 32 (C0) && 127-159(C1) +_js_escapes.update((ord("%c" % z), "\\u%04X" % z) for z in range(32)) +_js_escapes.update((ord("%c" % z), "\\u%04X" % z) for z in range(range(0x80, 0xA0))) @keep_lazy(SafeString)