Mark Sapiro writes: > On 7/8/16 6:04 PM, Yasuhito FUTATSUKI wrote: > > > > How about using 'backslashreplace' instead of 'replace' to encode to > > list's preferred language in Mailman/Handlers/SpamDetect.py ?
I see you've already done this, but ... I would consider xmlrefreplace as well. xmlrefs are something most people (users/moderators) have seen, backslash they're not going to recognize unless they're programmers. At an earlier stage, you could also just do a trial re-encoding with the list preferred codec, set errors = 'strict', catch the Exception, and re-raise as a Hold (or Discard, according to per-list policy). (Then discard the output.) I would prefer this solution, I think, as creating regexps turns out to be an issue for many list owners. People would have to learn not to use emoji in headers, of course, or suffer moderation delays or even discards. To the extent that this is only for the moderation interface, you could also use UTF-8 for the UI. Then the moderator would be able to see the emoji, rather than the owner having to bake in such knowledge in the regexps. FWIW, YMMV, etc ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/archive%40jab.org