aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers/Scrubber.py
diff options
context:
space:
mode:
authorbwarsaw <>2003-09-22 02:37:51 +0000
committerbwarsaw <>2003-09-22 02:37:51 +0000
commitc43087be33f78a895b74869800a775c4a0cb9a27 (patch)
tree7f5418e8b5a8eb70d0639ef9d11f16d685f57517 /Mailman/Handlers/Scrubber.py
parentd206e467d12f5e5a6e08f6ed11a559054f2e183f (diff)
downloadmailman2-c43087be33f78a895b74869800a775c4a0cb9a27.tar.gz
mailman2-c43087be33f78a895b74869800a775c4a0cb9a27.tar.xz
mailman2-c43087be33f78a895b74869800a775c4a0cb9a27.zip
Backporting from the HEAD -- updated handlers
Diffstat (limited to '')
-rw-r--r--Mailman/Handlers/Scrubber.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index b5be73df..7bc5f510 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -301,8 +301,11 @@ Url : %(url)s
try:
t = unicode(t, partcharset, 'replace')
except (UnicodeError, LookupError):
- # Replace funny characters
- t = unicode(t, 'ascii', 'replace').encode('ascii')
+ # Replace funny characters. We use errors='replace' for
+ # both calls since the first replace will leave U+FFFD,
+ # which isn't ASCII encodeable.
+ u = unicode(t, 'ascii', 'replace')
+ t = u.encode('ascii', 'replace')
try:
# Should use HTML-Escape, or try generalizing to UTF-8
t = t.encode(charset, 'replace')