[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Encoding of messages
From: |
Ted Zlatanov |
Subject: |
Re: Encoding of messages |
Date: |
Mon, 27 Aug 2007 10:16:35 -0500 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (darwin) |
On Wed, 22 Aug 2007 16:28:38 +0200 eric.boese-wolf@t-online.de (Eric Böse-Wolf)
wrote:
EB> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Gnus does not convert messages for storage AFAIK. What are you trying
>> to accomplish?
EB> I use spam.el with spam-use-bogofilter (bogofilter configured with
EB> unicode=yes and default_charset=utf-8) and I noticed correctly
EB> displayed german umlauts and badly displayed german umlauts in my
EB> bogoutil -d wordlist.db output. So I assumed bogofilter received
EB> messages in different encodings and wanted to stop that to get
EB> a nice and plain bogoutil -d wordlist.db output.
(I maintain spam.el)
The function that gets the article as a string is
(defun spam-get-article-as-string (article)
(when (numberp article)
(with-temp-buffer
(gnus-request-article-this-buffer
article
gnus-newsgroup-name)
(buffer-string))))
and then that string gets passed to bogofilter:
(when (stringp article-string)
(with-temp-buffer
(insert article-string)
(apply 'call-process-region
(point-min) (point-max)
spam-bogofilter-program
nil nil nil switch
(if db `("-d" ,db "-v") `("-v")))))))
So spam.el just passes the article as a string, using the
gnus-request-article-this-buffer function. We can change this if
necessary, to add extra parameters to bogofilter's invocation or to
spam-get-article-as-string to encode to UCS/UTF-8. I don't know much
about Gnus article encodings so I'm cc-ing this to the ding mailing list
as well in case someone can help.
Ted
p.s. your English is fine :)