diff options
-rwxr-xr-x | Bonus/goodict.cgi | 5 |
1 files changed, 3 insertions, 2 deletions
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 { |