Forum OpenACS Q&A: Response to spam module charset encoding issue when inserting to blob

hi Raoul,

There are two separate issues with this,
one is not diplaying correctly on the spam preview page,
and second not sending it correctly in the email body and title line.

First issue I let go since only admin will see it anyway.

Second issue you have to tell the mail client what charset you sending in and the system to encode it before sending to ns_sendmail. Spam module uses acs-mail package for sending emails.
As I see it the acs-mail package has not been modified to handle different charsets and it is sending out UTF-8.

Add lines setting headers "Conten-Type" and "Content-Encoding" in acs_mail_body_to_output_format in acs-mail/tcl/acs-mail-procs.tcl
and at the output of this proc $header_subject must be first treated with encoding convertto tcl fuction.
and in acs-mail-procs.tcl acs_mail_encode_content again specify "Content-Type"

let me know if you need more help.