[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

w3m-search



青田です。

w3m-searchを使ってGoogle検索した時に入力エンコードがUTF-8なのに、出力エンコードが
Shitf_JISになっているために、検索結果上部の、画像、ニュース、地図のリンクをたどった
先の検索キーワードが化けてしまっています。

ということで出力エンコードもUTF-8にするように変更するパッチです。
出力のデフォルトがShitf_JISのようなので入力をShift_JISにしているものは
今のところ大丈夫だとは思うのですが、一応、出力をShift_JISと明示するように
変更しています。

Index: ChangeLog
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/ChangeLog,v
retrieving revision 1.3015
diff -u -r1.3015 ChangeLog
--- ChangeLog	6 Jun 2007 01:18:30 -0000	1.3015
+++ ChangeLog	7 Jun 2007 12:06:58 -0000
@@ -1,3 +1,8 @@
+2007-06-07  Naohiro Aota  <nao.aota@xxxxxxxxx>
+
+	* w3m-search.el (w3m-search-engine-alist): Add output encoding argument
+	to google search.
+
 2007-06-06  Katsumi Yamaoka  <yamaoka@xxxxxxx>
 
 	* w3m-image.el (w3m-imagick-convert-program, w3m-resize-images): Reset
Index: w3m-search.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-search.el,v
retrieving revision 1.63
diff -u -r1.63 w3m-search.el
--- w3m-search.el	2 Feb 2007 03:02:41 -0000	1.63
+++ w3m-search.el	7 Jun 2007 12:06:59 -0000
@@ -75,53 +75,53 @@
       ,@(cond
 	 ((and ja utf-8)
 	  '(("google"
-	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=utf-8"
+	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=utf-8&oe=utf-8"
 	     utf-8)
 	    ("google-en"
-	     "http://www.google.com/search?q=%s&hl=en&ie=utf-8"
+	     "http://www.google.com/search?q=%s&hl=en&ie=utf-8&oe=utf-8"
 	     utf-8)))
 	 (ja
 	  '(("google"
-	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS"
+	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
 	     shift_jis)
 	    ("google-en"
 	     "http://www.google.com/search?q=%s&hl=en")))
 	 (utf-8
 	  '(("google"
-	     "http://www.google.com/search?q=%s&ie=utf-8"
+	     "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8"
 	     utf-8)
 	    ("google-en"
-	     "http://www.google.com/search?q=%s&hl=en&ie=utf-8"
+	     "http://www.google.com/search?q=%s&hl=en&ie=utf-8&oe=utf-8"
 	     utf-8)))
 	 (t
 	  '(("google"
 	     "http://www.google.com/search?q=%s")
 	    ("google-ja"
-	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS"
+	     "http://www.google.com/search?q=%s&hl=ja&lr=lang_ja&ie=Shift_JIS&oe=Shift_JIS"
 	     shift_jis))))
       ,@(cond
 	 ((and ja utf-8)
 	  '(("google news"
-	     "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s"
+	     "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s&oe=utf-8"
 	     utf-8)
 	    ("google news-en"
 	     "http://news.google.com/news?hl=en&q=%s")))
 	 (ja
 	  '(("google news"
-	     "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s"
+	     "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s&oe=Shift_JIS"
 	     shift_jis)
 	    ("google news-en"
 	     "http://news.google.com/news?hl=en&q=%s")))
 	 (utf-8
 	  '(("google news"
-	     "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s"
+	     "http://news.google.co.jp/news?hl=ja&ie=utf-8&q=%s&oe=utf-8"
 	     utf-8)
 	    ("google news-en"
 	     "http://news.google.com/news?hl=en&q=%s")))
 	 '(("google news"
 	    "http://news.google.com/news?q=%s")
 	   ("google news-ja"
-	    "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s"
+	    "http://news.google.co.jp/news?hl=ja&ie=Shift_JIS&q=%s&oe=Shift_JIS"
 	    shift_jis)))
       ("google groups"
        "http://groups.google.com/groups?q=%s")