Re: How to set charset in mutt for big5?
On Mon, Jan 01, 2001 at 04:22:46PM +0800, edward.@kimo.com wrote:
> yes, 但我目前唯一的困擾就是 Subject 的部份,無法使它不
> 編碼。編碼的結果,有些 MUA 或 news reader 會無法解碼,
> 縱使是和 metamail 配合,有人可以解決這個問題嗎?好像要
> 改 source code 才行?
>
The standard said you have to encode the non-ascii headers for
email. So... You that those OSS hackers how stubborn about
stick to the standard. :(
MUA that won't handle encoded header is broken. Fill a bug
report to the author.
> 我是使用 slrn 來讀 news 的,和 metamail 配合只能解決一部
> 份的問題,有人使用 slrn 的嗎?
>
apparently, slrn sucks here. Maybe you can pipe the article to
a decoder. But you still cannot see headers in the list view.
Maybe you can setup a nntp proxy on your box that uses filter
to decode headers. Okey, we already have a perl version,
here is my python version :)
--
Best regard
hashao
#!/usr/bin/env python
# Okey, it is not really a RFC 2231 decoder. It basically decodes
# the RFC 2047 header, and base64 only. Python don't do
# quopri.decodestring, so no luck for quoted print encoding.
# ha shao <hashao@chinese.com>
# Jan 1, 2001
import re
import fileinput
import base64
# import quopri
regexB = re.compile("(?:=\?[^\?]*\?B\?)([0-9a-zA-Z+/=]*)\?=")
def codematch(matchobj):
return base64.decodestring(matchobj.group(1))
for line in fileinput.input():
subject_string = regexB.match(line)
if regexB.search(line) != None :
line = regexB.sub(codematch, line, 0)
print line,
else:
print line,
Reply to: