From: W. Trevor King Date: Sat, 18 Jul 2009 13:31:44 +0000 (-0400) Subject: Hardcoded UTF-8 encoding in be-handle-mail. X-Git-Tag: 1.0.0~62^2~46^2~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef57ff352250c68c86d449fed426e825408ba916;p=be.git Hardcoded UTF-8 encoding in be-handle-mail. When run by procmail, the encoding returned by libbe.encoding.get_encoding is ANSI_X3.4-1968, which chokes on unicode output. I can't think of a more elegant solution than hardcoding in the default encoding. --- diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail index d8aafb2..e8de7ca 100755 --- a/interfaces/email/interactive/be-handle-mail +++ b/interfaces/email/interactive/be-handle-mail @@ -46,7 +46,8 @@ _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) BE_DIR = _THIS_DIR LOGPATH = os.path.join(_THIS_DIR, "be-handle-mail.log") LOGFILE = None -ENCODING = libbe.encoding.get_encoding() +#ENCODING = libbe.encoding.get_encoding() +ENCODING = "utf-8" ALLOWED_COMMANDS = ["new", "comment", "list", "show", "help"] @@ -232,7 +233,8 @@ def open_logfile(logpath=None): LOGPATH = os.path.join(_THIS_DIR, logpath) if LOGFILE == None and LOGPATH != "none": LOGFILE = codecs.open(LOGPATH, "a+", ENCODING) - + LOGFILE.write("Default encoding: %s\n" % ENCODING) + def close_logfile(): if LOGFILE != None and LOGPATH not in ["stderr", "none"]: LOGFILE.close()