Forums: users (Thread #13083)

iconvが異常終了するspam (2006-12-10 03:55 by Anonymous #26456)

bsfilter-1.0.15を使わせて頂いています。
素晴らしいスクリプトの開発・公開に感謝しております。

さて、表題の件なのですが、
文字コードが一部不正なのか、iconvが日本語部分の直前まで出力して異常終了してしまうspamが結構あります。
しかし、nkfは正常に通ってきちんと変換されてしまいます。
(私が受け取るspamは全てnkfは正常に通っています。)

このようなメールに対して、bsfilterでは特にエラー処理などをしていないようなので、結果として全く無力になってしまっています。
不正なものは不正でそれは仕方ないのですが、nkfなら読めるものまで見逃してしまうのはさすがに勿体ないし、実用上もちょっと困っています。来たメール自体は読めてしまうし。。

utf-8の自動認識の問題などでiconvがデフォルトになっているのかと思うのですが、iconvがエラーを返した場合はあらためてnkfに通す、というようにできないでしょうか?

Reply to #26456×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: iconvが異常終了するspam (2006-12-10 23:17 by nabeken #26471)

OS, iconvのインストール方法等、使用している環境を教えて下さい。

windowsについては、
http://nabeken.tdiary.net/20051106.html#p01
というような話もありましたので、ruby-1.8.4 ベースで
http://prdownloads.sourceforge.jp/bsfilter/23070/bsfilter-1.0.16.rc1.tgz
を作ってみました。(いままでは1.8.2)
Reply to #26456

Reply to #26471×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: iconvが異常終了するspam (2006-12-16 17:44 by Anonymous #26609)

お返事頂きありがとうございます。
遅くなってしまいました。また、環境について何も書いていませんでしたね。すみません。

2つの環境で全く同じ現象を確認しています。
(なので、universalな問題のように思ってしまったのですが。)
(1)
OS: Debian GNU/Linux sarge(3.1)
iconv: 2.3.2
(2)
OS: FreeBSD release-6.1
iconv: 1.9
です。
いずれもディストリビューション付属のもので、特別なことはしていないと思います。
特定のspamをiconvに通すと、

iconv: 位置 498 で不正な入力シーケンスがありました

のようなエラーメッセージを出して途中終了します。
いずれの環境においてもnkfでの変換は何ら問題ないのですが。
Reply to #26456

Reply to #26609×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: iconvが異常終了するspam (2006-12-16 21:24 by nabeken #26612)

nabeken at users.sourceforge.jp
まで、エラーするメールを送って貰えますでしょうか。
Reply to #26609

Reply to #26612×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login