Better unicode handling in be-handle-mail.
authorW. Trevor King <wking@drexel.edu>
Sat, 18 Jul 2009 11:43:29 +0000 (07:43 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 18 Jul 2009 11:43:29 +0000 (07:43 -0400)
commit467db1a731630891c28cfa78a3a754cdc3027555
tree492bb0e0c9d3198669407912fd302a000e5c1c5a
parent54113960c5633c4f43865f68c8463e05d1cfbc1a
Better unicode handling in be-handle-mail.

be-handle-mail now gets a bit further on
  cat examples/unicode | ./be-handle-mail -o -l - 2>&1 1>/dev/null
It successfully reads in unicode output from the command execution and
successfully prints that output to the log ("-l - 2>&1 1>/dev/null" sets
up the log to be printed to the terminal's stdout).  However, it chokes
later on with
  responding to John Doe <jdoe@example.com>: show
  Traceback (most recent call last):
    File "./be-handle-mail", line 274, in <module>
      main()
    File "./be-handle-mail", line 266, in main
      response_email = compose_response(ret, out_text, err_text, info).plain()
    File "./be-handle-mail", line 210, in compose_response
      LOGFILE.write("\n%s\n\n" % send_pgp_mime.flatten(response_email.plain()))
    File "/home/wking/src/fun/be/be.email/interfaces/email/interactive/send_pgp_mime.py", line 165, in flatten
      g.flatten(msg)
    File "/usr/lib/python2.5/email/generator.py" ...
    ...
  UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 2581: ordinal not in
  range(128)
interfaces/email/interactive/be-handle-mail