Package: rss2mail Version: 1:2.60-6 Severity: wishlist Tags: patch Currently, rss2email choose one of 'US-ASCII', 'ISO-8859-1' and 'UTF-8' for the charset of e-mail.
'ISO-8859-1' is hard coded in rss2email.py, but I'd like to use the
charset 'ISO-2022-JP' instead of 'ISO-8859-1'.
The attached patch grants my wish. It defines new variable
PREFERRED_CHARSET for the chrset of e-mail prefferd over 'UTF-8'.
Please consider applying it.
Note: end-of-line of rss2email.py is dos-style (CR LF). Take care
when applying the patch.
Thanks,
--
Tatsuya Kinoshita
--- rss2email-2.60-6/rss2email.py
+++ rss2email-2.60/rss2email.py
@@ -67,6 +67,9 @@
SMTP_USER = 'username' # for SMTP AUTH, set SMTP username here
SMTP_PASS = 'password' # for SMTP AUTH, set SMTP password here
+# The charset of email prefferd to UTF-8.
+PREFERRED_CHARSET = 'ISO-8859-1'
+
# Set this to add a bonus header to all emails (start with '\n').
BONUS_HEADER = ''
# Example: BONUS_HEADER = '\nApproved: [EMAIL PROTECTED]'
@@ -101,16 +104,17 @@
The email will be properly MIME encoded and delivered though SMTP to
localhost port 25. This is easy to change if you want something
different.
- The charset of the email will be the first one out of US-ASCII,
ISO-8859-1
- and UTF-8 that can represent all the characters occurring in the email.
+ The charset of the email will be the first one out of US-ASCII,
+ a value of PREFERRED_CHARSET and UTF-8 that can represent all the
+ characters occurring in the email.
"""
# Header class is smart enough to try US-ASCII, then the charset we
# provide, then fall back to UTF-8.
- header_charset = 'ISO-8859-1'
+ header_charset = PREFERRED_CHARSET
# We must choose the body charset manually
- for body_charset in 'US-ASCII', 'ISO-8859-1', 'UTF-8':
+ for body_charset in 'US-ASCII', PREFERRED_CHARSET, 'UTF-8':
try:
body.encode(body_charset)
except UnicodeError:
pgpHFXjNtb8wP.pgp
Description: PGP signature

