Mail charset error support
- Try multiple charset when no charset is specified by "Content-Type" field : begins with sys.defaultencoding utf8 then "iso-8859-1", config file encoding and finally encoding found in previous fields "Subject" or "From". darcs-hash:20060201110843-86b55-7fd556a8ffadd9a5fed2b3317b17bfcca9d1dc58.gz
This commit is contained in:
2
jmc.py
2
jmc.py
@@ -26,6 +26,7 @@ import sys
|
||||
import os.path
|
||||
import logging
|
||||
|
||||
from jabber import mailconnection
|
||||
from jabber.component import MailComponent, ComponentFatalError
|
||||
from jabber.config import Config
|
||||
|
||||
@@ -46,6 +47,7 @@ def main(config_file = "jmc.xml", isDebug = 0):
|
||||
str(sys.exc_value)
|
||||
sys.exit(1)
|
||||
|
||||
mailconnection.default_encoding = config.get_content("config/mail_default_encoding")
|
||||
print "creating component..."
|
||||
mailcomp = MailComponent(config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user