用 mailcap 配置 w3m -I %{charset} -dump %s;,可实现在 mutt 中自动显示 html 格式的中文邮件。

当 mutt 传递 gb2312 给 w3m 的 %{charset} 参数时,个别超出 gb2312 编码的汉字在 w3m -dump 的结果中不能正常显示,如软件的

导致这些汉字在 mutt 中显示为乱码。考虑到非中文编码的邮件,不能用 GB18030 直接替换 %{charset} 参数。

试过 mutt 的 charset-hook 参数设定 gb2312 为 gb18030 的别名,但传递给 w3m 的 %{charset} 参数没变,仍然是 gb2312。

还尝试用 procmail 在分拣时直接修改 Content-Type: 栏目的 charset 参数为 gb18030,未果。

最后直接改了 w3m 的一行代码,把 GB2312 作为 GB18030 的别名处理。即 w3m -I gb2312 等同于 w3m -I gb18030。

squeeze-backports(i386): https://blog.du1ab.org/debian/w3m/0.5.3-2~ppa/