From 9a82b18c721a40d58b86792fc7740bd33607ec85 Mon Sep 17 00:00:00 2001 From: yshl Date: Tue, 28 Jul 2015 20:58:02 +0900 Subject: modified: Bonus/goodict.cgi, use Encode.pm instead of NKF --- Bonus/goodict.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Bonus') diff --git a/Bonus/goodict.cgi b/Bonus/goodict.cgi index 8f443c1..5106c89 100755 --- a/Bonus/goodict.cgi +++ b/Bonus/goodict.cgi @@ -5,7 +5,8 @@ # w: file:/cgi-bin/goodict.cgi?%s # j: file:/cgi-bin/goodict.cgi?%s -use NKF; +use Encode; +use Encode::Guess qw/euc-jp utf8/; #$mode = 0; # substring $mode = 1; # perfect match #$mode = 3; # search body text @@ -22,7 +23,7 @@ s@^[ewjs]:@@ && s@^//@@ && s@/$@@; if ($_) { s/\+/ /g; s/%([\da-f][\da-f])/pack('C', hex($1))/egi; - $_ = nkf("-e", $_); + $_ = encode("utf8", decode("Guess", $_)); s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; $url .= "/search.php?MT=$_&kind=$kind&mode=$mode"; } else { -- cgit v1.2.3