From 263f414718fbd7d57afe67b19580bd212566a619 Mon Sep 17 00:00:00 2001 From: morimoto Date: Sun, 29 Jun 2008 09:20:49 +0000 Subject: [PATCH] Changed file charset to utf-8 --- keitairc | 40 ++++++++++++++---------------- lib/Keitairc/ClientInfo.pm | 14 +++++------ lib/Keitairc/Config.pm | 4 +-- lib/Keitairc/IrcBuffer.pm | 13 ++++++---- lib/Keitairc/IrcCallback.pm | 20 +++++++-------- lib/Keitairc/Plugins.pm | 4 +-- lib/Keitairc/SessionManager.pm | 38 ++++++++++++++--------------- lib/Keitairc/View.pm | 4 +-- lib/plugins/00all | 6 ++--- lib/plugins/00index | 20 +++++++-------- lib/plugins/00location | 12 ++++----- lib/plugins/00location_receiver | 54 ++++++++++++++++++++--------------------- lib/plugins/00nick | 6 ++--- lib/plugins/00postme | 4 +-- lib/plugins/00recent | 6 ++--- lib/plugins/00topic | 8 +++--- lib/plugins/00unread | 6 ++--- lib/plugins/10url | 6 ++--- lib/plugins/11url_session | 8 +++--- lib/plugins/12keyword | 6 ++--- lib/plugins/20mail | 6 ++--- lib/plugins/20phone | 6 ++--- lib/plugins/30prefectures | 11 ++++----- lib/plugins/31distinct | 17 ++++++------- lib/plugins/32address | 4 +-- 25 files changed, 159 insertions(+), 164 deletions(-) diff --git a/keitairc b/keitairc index 2dd552e..d4ca232 100755 --- a/keitairc +++ b/keitairc @@ -1,6 +1,7 @@ #!/usr/bin/perl +# -*- mode: perl; coding: utf-8 -*- # keitairc -# $Id: keitairc,v 1.58 2008-06-29 07:55:01 morimoto Exp $ +# $Id: keitairc,v 1.59 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/keitairc,v $ # # Copyright (c) 2003-2008 Jun Morimoto @@ -190,10 +191,10 @@ sub add_cookie{ } ################################################################ -# ’ʏ탍ƒOƒCƒ“‚ÌPOSTæ -# ƒpƒXƒ[ƒh‚ðƒ`ƒFƒbƒN‚µ‚Ä -# ŠÔˆá‚Á‚Ä‚¢‚½‚ç / ‚ÖƒŠƒ“ƒN‚µ‚ďI‚í‚è -# ‡‚Á‚Ä‚¢‚½‚çƒZƒbƒVƒ‡ƒ“‚𔭍s‚µ /{SESSION}/index ‚Ö +# 通常ログインのPOST先 +# パスワードをチェックして +# 間違っていたら / へリンクして終わり +# 合っていたらセッションを発行し /{SESSION}/index へ sub action_login{ my $request = shift; my $ci = new Keitairc::ClientInfo($request); @@ -231,9 +232,9 @@ sub action_robots_txt{ } ################################################################ -# ‚©‚ñ‚½‚ñƒƒOƒCƒ“‚ÌPOSTæ -# DoCoMo‚¾‚Á‚½‚çicc‚ª—ˆ‚Ä‚¢‚é‚Í‚¸‚È‚Ì‚Å, icc + user_agent ‚Ń`ƒFƒbƒNB -# ‡‚Á‚Ä‚¢‚½‚çƒZƒbƒVƒ‡ƒ“•œ‹A‚µ‚Ä /{SESSION}/index ‚Ö +# かんたんログインのPOST先 +# DoCoMoだったらiccが来ているはずなので, icc + user_agent でチェック。 +# 合っていたらセッション復帰して /{SESSION}/index へ sub action_login_icc{ my $request = shift; my $ci = new Keitairc::ClientInfo($request); @@ -267,9 +268,9 @@ sub action_login_icc{ } ################################################################ -# ‚©‚ñ‚½‚ñƒƒOƒCƒ“‚ÌPOSTæ -# DoCoMo‚¾‚Á‚½‚çiƒ‚[ƒhID‚ª—ˆ‚Ä‚¢‚é‚Í‚¸‚È‚Ì‚Å, iƒ‚[ƒhID + user_agent ‚Ń`ƒFƒbƒNB -# ‡‚Á‚Ä‚¢‚½‚çƒZƒbƒVƒ‡ƒ“•œ‹A‚µ‚Ä /{SESSION}/index ‚Ö +# かんたんログインのPOST先 +# DoCoMoだったらiモードIDが来ているはずなので, iモードID + user_agent でチェック。 +# 合っていたらセッション復帰して /{SESSION}/index へ sub action_login_imodeid{ my $request = shift; my $ci = new Keitairc::ClientInfo($request); @@ -402,9 +403,8 @@ sub send_message{ if(length($message)){ my $jis = $message; - my $euc = $message; Encode::from_to($jis, $cf->web_charset(), $cf->irc_charset()); - Encode::from_to($euc, $cf->web_charset(), 'euc-jp'); + my $euc = Encode::decode($cf->web_charset(), $message); if($jis =~ s|^/||) { my ($params, $trailing) = split(/ :/, $jis, 2); my @postcmd = split(/ /, $params); @@ -432,14 +432,12 @@ sub send_message{ } ################################################################ -# “ü—Í‚Í euc-jp +# 入力 charset は perl internal sub render_line{ - local($_); - my $in = shift; - my $session_id = shift; - my $reverse = shift; + my ($in, $session_id, $reverse) = @_; my @message; my $buf; + local($_); @message = (split("\n", $in))[0 .. $cf->web_lines()]; if ($reverse) { @@ -455,14 +453,12 @@ sub render_line{ for my $name ($pl->list_replace_plugins()){ last if s/$pl->{plugins}->{$name}->{message_replace_regexp}/$pl->{plugins}->{$name}->{message_replace_imprementation}($session_id, $1, $2, $3, $4, $5, $6, $7, $8, $9)/eg; } - s/\s+$//; s/\s+/ /g; $buf .= "$_
"; } - - Encode::from_to($buf, 'euc-jp', $cf->web_charset()); - $buf; + # Encode::from_to($buf, 'euc-jp', $cf->web_charset()); + return Encode::encode($cf->web_charset(), $buf); } ################################################################ diff --git a/lib/Keitairc/ClientInfo.pm b/lib/Keitairc/ClientInfo.pm index 9cd5031..a85ed31 100644 --- a/lib/Keitairc/ClientInfo.pm +++ b/lib/Keitairc/ClientInfo.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::ClientInfo -# $Id: ClientInfo.pm,v 1.5 2008-06-29 07:55:01 morimoto Exp $ +# $Id: ClientInfo.pm,v 1.6 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/ClientInfo.pm,v $ # # Copyright (c) 2008 Jun Morimoto @@ -105,10 +105,10 @@ sub softbank_serial{ sub docomo_foma_icc{ my $me = shift; if($me->is_docomo()){ - # NTT DoCoMo¤ÎFOMAüËöÀ½Â¤ÈÖ¹æ (15·å¤Î¥æ¥Ë¡¼¥¯¤Ê±Ñ¿ô»ú) ¤ª¤è¤Ó - # FOMA¥«¡¼¥ÉÀ½Â¤ÈÖ¹æ (20·å¤Î¥æ¥Ë¡¼¥¯¤Ê±Ñ¿ô»ú) + # NTT DoCoMoのFOMA端末製造番号 (15桁のユニークな英数字) および + # FOMAカード製造番号 (20桁のユニークな英数字) # http://www.nttdocomo.co.jp/service/imode/make/content/html/tag/utn.html - # ¼ÂºÝ¤Ë¤Ïlower case¤â»È¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ + # 実際にはlower caseも使われているようなので注意 # DoCoMo/2.0 P703imyu(c100;TB;W30H15) # DoCoMo/2.0 P703imyu(c100;TB;W30H15;ser12345ABCDE12345;icc12345ABCDE12345abcde) if($me->{header}->{user_agent} =~ /;(icc[0-9a-zA-Z]{20})/){ @@ -144,8 +144,8 @@ sub serial_key{ } ################################################################ -# Cookie¤ò°·¤¨¤ë¤«¤É¤¦¤« -# ¤È¤ê¤¢¤¨¤º Cookie ¤ò³Î¼Â¤Ë°·¤¨¤Ê¤¤ DoCoMo ¤òȽÄꤷ¤Æ¤ë¤À¤± +# Cookieを扱えるかどうか +# とりあえず Cookie を確実に扱えない DoCoMo を判定してるだけ sub cookie_available{ my $me = shift; unless($me->is_docomo()){ diff --git a/lib/Keitairc/Config.pm b/lib/Keitairc/Config.pm index 8a9a488..5ea0cbf 100644 --- a/lib/Keitairc/Config.pm +++ b/lib/Keitairc/Config.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::Config -# $Id: Config.pm,v 1.15 2008-06-29 07:55:01 morimoto Exp $ +# $Id: Config.pm,v 1.16 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Config.pm,v $ # # Copyright (c) 2008 Jun Morimoto diff --git a/lib/Keitairc/IrcBuffer.pm b/lib/Keitairc/IrcBuffer.pm index c9b55fd..e16143f 100644 --- a/lib/Keitairc/IrcBuffer.pm +++ b/lib/Keitairc/IrcBuffer.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::IrcBuffer -# $Id: IrcBuffer.pm,v 1.14 2008-06-29 07:55:01 morimoto Exp $ +# $Id: IrcBuffer.pm,v 1.15 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/IrcBuffer.pm,v $ # # Copyright (c) 2008 Jun Morimoto @@ -27,12 +27,14 @@ sub new{ $me->{cid2name} = {}; $me->{name2cid} = {}; - # join しているtopicの名称を記録するハッシュ (jis) + # join しているtopicの名称を記録するハッシュ + # charset: perl internal $me->{topic} = {}; $me->{nicks} = {}; - # チャネルの会話内容を記録するハッシュ (euc-jp) + # チャネルの会話内容を記録するハッシュ + # charset: perl internal $me->{buffer} = {}; $me->{unread} = {}; @@ -211,7 +213,8 @@ sub buffer{ } ################################################################ -# 引数の $msg は euc-jp, $channel は jis +# 引数の $msg の charset は perl internal +# $channel は iso-2022-jp または irc channel specific sub add_message{ my($me, $cid, $message, $who) = @_; diff --git a/lib/Keitairc/IrcCallback.pm b/lib/Keitairc/IrcCallback.pm index 44b5669..b4c4d34 100644 --- a/lib/Keitairc/IrcCallback.pm +++ b/lib/Keitairc/IrcCallback.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::IrcCallback -# $Id: IrcCallback.pm,v 1.13 2008-06-29 07:55:01 morimoto Exp $ +# $Id: IrcCallback.pm,v 1.14 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/IrcCallback.pm,v $ # # Copyright (c) 2008 Jun Morimoto @@ -48,7 +48,7 @@ sub irc_public{ my $ib = $heap->{IrcBuffer}; my $cf = $heap->{Config}; $who =~ s/!.*//; - Encode::from_to($msg, $cf->irc_charset(), 'euc-jp'); + $msg = Encode::decode($cf->irc_charset(), $msg); my $cid = $ib->name2cid($channel->[0]); $heap->{IrcBuffer}->add_message($cid, $msg, $who); $heap->{seen_traffic} = 1; @@ -71,7 +71,6 @@ sub irc_join{ my $cid = $ib->name2cid($channel); if ($cf->show_console()) { my $ch = $ib->compact_channel_name($cid); - $ch = encode('euc-jp', $ch); $ib->add_message($ib->name2cid('*Console*'), "$who joined to $ch"); } else { @@ -100,7 +99,6 @@ sub irc_part{ } elsif ($cf->show_joinleave()) { if ($cf->show_console()) { my $ch = $ib->compact_channel_name($cid); - $ch = encode('euc-jp', $ch); $ib->add_message($ib->name2cid('*Console*'), "$who leaves from $ch"); } else { @@ -119,7 +117,7 @@ sub irc_quit{ my $cf = $heap->{Config}; $who =~ s/!.*//; - Encode::from_to($message, $cf->irc_charset(), 'euc-jp'); + $message = Encode::decode($cf->irc_charset(), $message); for my $cid ($ib->channels()) { for my $name ($ib->list_nick($cid)) { @@ -222,7 +220,8 @@ sub irc_notice{ $who =~ s/!.*//; my $cid = $ib->name2cid($channel->[0]); - Encode::from_to($msg, $cf->irc_charset(), 'euc-jp'); + $msg = Encode::decode($cf->irc_charset(), $msg); + $ib->add_message($cid, $msg, $who); $heap->{seen_traffic} = 1; $heap->{disconnect_msg} = 1; @@ -235,7 +234,7 @@ sub irc_topic{ my $cf = $heap->{Config}; my $cid = $ib->name2cid($channel); $who =~ s/!.*//; - Encode::from_to($topic, $cf->irc_charset(), 'euc-jp'); + $topic = Encode::decode($cf->irc_charset(), $topic); $ib->add_message($cid, "$who set topic: $topic"); $ib->topic($cid, $topic); $heap->{seen_traffic} = 1; @@ -270,8 +269,7 @@ sub irc_msg{ } $ib->join($buddy); # XXX: join $buddy if not joined my $cid = $ib->name2cid($buddy); - - Encode::from_to($msg, $cf->irc_charset(), 'euc-jp'); + $msg = Encode::decode($cf->irc_charset(), $msg); $ib->add_message($cid, $msg, $who); $heap->{seen_traffic} = 1; $heap->{disconnect_msg} = 1; @@ -285,7 +283,7 @@ sub irc_ctcp_action{ $who =~ s/!.*//; my $cid = $ib->name2cid($channel->[0]); - Encode::from_to($msg, $cf->irc_charset(), 'euc-jp'); + $msg = Encode::decode($cf->irc_charset(), $msg); $ib->add_message($cid, sprintf('* %s %s', $who, $msg)); $heap->{seen_traffic} = 1; $heap->{disconnect_msg} = 1; diff --git a/lib/Keitairc/Plugins.pm b/lib/Keitairc/Plugins.pm index 2893da8..9b94823 100644 --- a/lib/Keitairc/Plugins.pm +++ b/lib/Keitairc/Plugins.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::Plugins -# $Id: Plugins.pm,v 1.4 2008-06-29 07:55:01 morimoto Exp $ +# $Id: Plugins.pm,v 1.5 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Plugins.pm,v $ # # Copyright (c) 2008 Jun Morimoto diff --git a/lib/Keitairc/SessionManager.pm b/lib/Keitairc/SessionManager.pm index 137f416..a7e83bf 100644 --- a/lib/Keitairc/SessionManager.pm +++ b/lib/Keitairc/SessionManager.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::SessionManager -# $Id: SessionManager.pm,v 1.5 2008-06-29 07:55:01 morimoto Exp $ +# $Id: SessionManager.pm,v 1.6 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/SessionManager.pm,v $ # # Copyright (c) 2008 Jun Morimoto @@ -12,7 +12,7 @@ use warnings; ################################################################ # my $sm = new Keitairc::SessionManager; -# ¥ª¥×¥·¥ç¥ó¤Ç ttl ¤ò»ØÄê²Äǽ +# オプションで ttl を指定可能 # my $sm = new Keitairc::SessionManager({default_ttl => 120}); sub new{ my $proto = shift; @@ -37,24 +37,24 @@ sub verify{ if(defined $arg->{serial_key}){ if($s = $me->search_by_serial_key($arg->{serial_key}, $user_agent)){ - # ¥¢¥¯¥»¥¹¤Ë¹çÃפ¹¤ëÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¤¬¸«¤Ä¤«¤Ã¤¿¤é - # ¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¹¹¿·¤·¤ÆÀ®¸ù¤òÊÖ¤¹ + # アクセスに合致する有効なセッションが見つかったら + # タイムスタンプを更新して成功を返す return $me->refresh($s->{id}, $user_agent); } } if(defined $arg->{session_id}){ if($s = $me->search_by_session_id($arg->{session_id}, $user_agent)){ - # ¥¢¥¯¥»¥¹¤Ë¹çÃפ¹¤ëÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¤¬¸«¤Ä¤«¤Ã¤¿¤é - # ¥¿¥¤¥à¥¹¥¿¥ó¥×¤ò¹¹¿·¤·¤ÆÀ®¸ù¤òÊÖ¤¹ + # アクセスに合致する有効なセッションが見つかったら + # タイムスタンプを更新して成功を返す return $me->refresh($s->{id}, $user_agent); } } } ################################################################ -# »ØÄê¤Î¥»¥Ã¥·¥ç¥óIDʸ»úÎó¤Î¥»¥Ã¥·¥ç¥ó¤¬¤¢¤ë¤«Ä´¤Ù¡¢ -# ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹ +# 指定のセッションID文字列のセッションがあるか調べ、 +# セッションオブジェクトを返す # $sm->search_by_session_id($session_id, $user_agent); sub search_by_session_id{ my $me = shift; @@ -72,8 +72,8 @@ sub search_by_session_id{ } ################################################################ -# »ØÄê¤Î¥»¥Ã¥·¥ç¥óIDʸ»úÎó¤Î¥»¥Ã¥·¥ç¥ó¤¬¤¢¤ë¤«Ä´¤Ù¡¢ -# ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹ +# 指定のセッションID文字列のセッションがあるか調べ、 +# セッションオブジェクトを返す # $sm->search_by_serial_key($serial_key, $user_agent); sub search_by_serial_key{ my $me = shift; @@ -92,8 +92,8 @@ sub search_by_serial_key{ } ################################################################ -# »ØÄê¤Î¥»¥Ã¥·¥ç¥óIDʸ»úÎó¤Î¥»¥Ã¥·¥ç¥ó¤ÎºÇ½ª»þ¹ï¤ò¹¹¿·¤·¡¢ -# ¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹ +# 指定のセッションID文字列のセッションの最終時刻を更新し、 +# セッションオブジェクトを返す # $sm->refresh($session_id, $user_agent); sub refresh{ my $me = shift; @@ -114,8 +114,8 @@ sub refresh{ } ################################################################ -# ¿·¤¿¤Ê¥»¥Ã¥·¥ç¥ó¤ò»Ï¤á¡¢¥»¥Ã¥·¥ç¥ó¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹ -# ǧ¾Ú¤¬À®¸ù¤·¤¿Ä¾¸å¤Ê¤É¡¢Í­°Õ¤Ê¤È¤­°Ê³°¤Ë¤ä¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤ +# 新たなセッションを始め、セッションオブジェクトを返す +# 認証が成功した直後など、有意なとき以外にやってはいけない # $sm->add($user_agent, [$serial_key]); sub add{ my $me = shift; @@ -153,7 +153,7 @@ sub add{ } ################################################################ -# TTL¤¬²á¤®¤¿¥»¥Ã¥·¥ç¥ó¤òËõ¾Ã +# TTLが過ぎたセッションを抹消 # $sm->garbage_collect(); sub garbage_collect{ my $me = shift; @@ -174,15 +174,15 @@ sub delete{ } ################################################################ -# USER_AGENTʸ»úÎ󤫤顢¥»¥Ã¥·¥ç¥óȽÄê¤Î˸¤²¤È¤Ê¤ëÍ×ÁǤò¼è¤ë +# USER_AGENT文字列から、セッション判定の妨げとなる要素を取る sub normalize_user_agent{ my $me = shift; my $user_agent = shift; # ::log_debug("normalize_user_agent: user_agent[$user_agent]"); - # NTT DoCoMo¤ÎFOMAüËöÀ½Â¤ÈÖ¹æ (15·å¤Î¥æ¥Ë¡¼¥¯¤Ê±Ñ¿ô»ú) ¤ª¤è¤Ó - # FOMA¥«¡¼¥ÉÀ½Â¤ÈÖ¹æ (20·å¤Î¥æ¥Ë¡¼¥¯¤Ê±Ñ¿ô»ú) ¤ò½üµî + # NTT DoCoMoのFOMA端末製造番号 (15桁のユニークな英数字) および + # FOMAカード製造番号 (20桁のユニークな英数字) を除去 # http://www.nttdocomo.co.jp/service/imode/make/content/html/tag/utn.html # DoCoMo/2.0 P703imyu(c100;TB;W30H15) # DoCoMo/2.0 P703imyu(c100;TB;W30H15;ser123451234512345;icc12345678901234567890) diff --git a/lib/Keitairc/View.pm b/lib/Keitairc/View.pm index a72b86f..994c39d 100644 --- a/lib/Keitairc/View.pm +++ b/lib/Keitairc/View.pm @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # Keitairc::View -# $Id: View.pm,v 1.13 2008-06-29 07:55:01 morimoto Exp $ +# $Id: View.pm,v 1.14 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/View.pm,v $ # # Copyright (c) 2008 Jun Morimoto diff --git a/lib/plugins/00all b/lib/plugins/00all index b61112f..83e604b 100644 --- a/lib/plugins/00all +++ b/lib/plugins/00all @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00all -# ƒ`ƒƒƒlƒ‹‚Ì‘SƒƒbƒZ[ƒW‰{—— -# $Id: 00all,v 1.8 2008-06-29 07:55:01 morimoto Exp $ +# チャネルの全メッセージ閲覧 +# $Id: 00all,v 1.9 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00all,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/00index b/lib/plugins/00index index b147b06..3a0e29b 100644 --- a/lib/plugins/00index +++ b/lib/plugins/00index @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00index -# ƒ`ƒƒƒlƒ‹ˆê—— -# $Id: 00index,v 1.7 2008-06-29 07:55:01 morimoto Exp $ +# チャネル一覧 +# $Id: 00index,v 1.8 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00index,v $ # The line number (1 incremented) and filename below must be @@ -23,21 +23,21 @@ $plugin = { return if($mtime <= 0); my $timediff = time - $mtime; if($timediff < 60){ - return $timediff . '•b'; + return $timediff . '秒'; } if($timediff < 3600){ - return int($timediff/60) . '•ª'; + return int($timediff/60) . '分'; } if($timediff < 86400){ - return int($timediff/3600) . 'ŽžŠÔ'; + return int($timediff/3600) . '時間'; } if($timediff < 86400 * 30){ - return int($timediff/86400) . '“ú'; + return int($timediff/86400) . '日'; } if($timediff < 86400 * 365){ - return int($timediff/86400/30) . 'ƒ–ŒŽ'; + return int($timediff/86400/30) . 'ヶ月'; } - return int($timediff/86400/365) . '”N'; + return int($timediff/86400/365) . 'å¹´'; }; my @loop; @@ -59,7 +59,7 @@ $plugin = { } $accesskey++; - # –¢“Ǎs” + # 未読行数 if($::ib->unread_lines($cid)){ $p->{unread} = sprintf(' %s', diff --git a/lib/plugins/00location b/lib/plugins/00location index 13566ad..923ad12 100644 --- a/lib/plugins/00location +++ b/lib/plugins/00location @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00location -# °ÌÃÖ¾ðÊóÁ÷¿® -# $Id: 00location,v 1.5 2008-06-29 07:55:01 morimoto Exp $ +# 位置情報送信 +# $Id: 00location,v 1.6 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00location,v $ # The line number (1 incremented) and filename below must be @@ -9,9 +9,9 @@ # line 10 "keitairc/lib/plugins/00location" # http://siisise.net/gps.html -# °ÌÃÖ -# au¤Ç¤Ïdatum=1¤È¤«unit=1»ØÄꤷ¤Æ¤â0¤Ë¤Ê¤Ã¤Á¤ã¤¦Ã¼Ëö¤¬¤¢¤ë¤è¤¦¤Ê¤Î¤Ç¡¢ -# ¤â¤È¤«¤é0¤ò»ØÄꤷ¤¿¤Û¤¦¤¬ÌµÆñ +# 位置 +# auではdatum=1とかunit=1指定しても0になっちゃう端末があるようなので、 +# もとから0を指定したほうが無難 $plugin = { name => 'location', diff --git a/lib/plugins/00location_receiver b/lib/plugins/00location_receiver index 8282d86..33e2e33 100644 --- a/lib/plugins/00location_receiver +++ b/lib/plugins/00location_receiver @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00location_receiver -# °ÌÃÖ¾ðÊóÁ÷¿®¡¢¤Î¥³¡¼¥ë¥Ð¥Ã¥¯ -# $Id: 00location_receiver,v 1.11 2008-06-29 07:55:01 morimoto Exp $ +# 位置情報送信、のコールバック +# $Id: 00location_receiver,v 1.12 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00location_receiver,v $ # The line number (1 incremented) and filename below must be @@ -12,7 +12,7 @@ use Net::HTTP; use XML::Simple; use Encode; -# WGS84·Ï¤òÅϤ¹¤³¤È +# WGS84系を渡すこと sub get_rgeocode_xml { my ($lat, $lon) = @_; my $s = Net::HTTP->new(Host => 'refits.cgk.affrc.go.jp') || return; @@ -89,20 +89,20 @@ $plugin = { $p->{cid} = $cid; $p->{channel_compact} = $::ib->simple_escape(encode($::cf->web_charset(), $::ib->compact_channel_name($cid))); - # ¬ÃÏ·Ï - # °Ê²¼¤Î2¤Ä¤Î¬ÃϷϤÎÃ椫¤é»ÈÍѤ·¤Æ¤¤¤ë¬ÃϷϤò¼¨¤¹¡£ - # wgs84 WGS84·Ï: GPS¬Î̤ǻ»½Ð¤µ¤ì¤ëºÂɸ·Ï¡£¿ô²ó¤Î²þÄê - # ¤Ë¤è¤ê¸½ºß¤Ç¤ÏITRFºÂɸ·Ï¤È¼ÂÍѾå¤Îº¹°Û¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤ - # ¤ë¡£ - # tokyo ÆüËܬÃÏ·Ï: ¬ÎÌË¡»Ü¹ÔÎáÂè2¾ò¤ÇÄê¤á¤é¤ì¤¿ÆüËÜɸ - # ½à¤Î¬ÃÏ·Ï¡£ - # È÷¹Í: °ú¿ôÆâÍƤȤ·¤Æ¤Ï"tokyo"¤È¤¤¤¦É½¼¨¤Ë¤Ê¤ë¤¬¡¢¼ÂºÝ - # ¤Î¬ÃϷϤÏWGS84·Ï¤Î¥Ç¡¼¥¿¤ò»ÈÍÑ¡£ + # 測地系 + # 以下の2つの測地系の中から使用している測地系を示す。 + # wgs84 WGS84ç³»: GPS測量で算出される座標系。数回の改定 + # により現在ではITRF座標系と実用上の差異はなくなってい + # る。 + # tokyo 日本測地系: 測量法施行令第2条で定められた日本標 + # 準の測地系。 + # 備考: 引数内容としては"tokyo"という表示になるが、実際 + # の測地系はWGS84系のデータを使用。 # from http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html # NTT DoCoMo if($ci->is_docomo()){ - # i¥¨¥ê¥¢¤ÏPOST¤ÇÍè¤ë + # iエリアはPOSTで来る # ACTN=OK&LAT=%2B35.44.27.996&LON=%2B139.35.37.932&GEO=wgs84&XACC=1&POSINFO=2 my ($wx, $wy); my $posted = $request->content(); @@ -116,7 +116,7 @@ $plugin = { $posted{LON} =~ s/^%2b//i; ($wx, $wy) = (dms_to_degree($posted{LAT}), dms_to_degree($posted{LON})); }else{ - # i¥¨¥ê¥¢¤¸¤ã¤Ê¤¤¤«¤élcs¤«¤Ê + # iエリアじゃないからlcsかな # GET /loc.jsp?lat=%2B35.40.53.008&lon=%2B139.45.57.971&geo=WGS84&x-acc=3 # see http://www.utilz.jp/wiki/Gps unless(defined $h{lat}){ @@ -157,13 +157,13 @@ $plugin = { } # Softbank - # HTTP¥Ø¥Ã¥À¡¼¤Îx-jphone-geocode¤Ë°ÌÃÖ¾ðÊó¤¬ÄÌÃΤµ¤ì¤Þ¤¹¡£ - # x-jphone-geocode: 354053%1A1394557%1A(½»½ê¤¬SJIS¤Ç¥¨ - # ¥ó¥³¡¼¥É¤µ¤ì¤¿¤â¤Î) "%1A"(SUB)¤Ç¶èÀÚ¤é¤ì¤Æ lat, lon, - # ½»½ê(SJIS¤Ç¥¨¥ó¥³¡¼¥É)¤Î·Á¼°¤Ë¤Ê¤ê¤Þ¤¹¡£½»½ê¤Ï¥É¥­¥å - # ¥á¥ó¥È¤ò¸«¤ë¸Â¤êSJIS¤Ç¥¨¥¹¥±¡¼¥×¤·¤¿¤â¤Î¤È¤Ê¤Ã¤Æ¤¤¤Þ - # ¤¹¤¬¡¢Àµ¤·¤¯¥Ç¥³¡¼¥É¤Ç¤­¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤·¤¿¡£¤³¤Î¾ð - # Êó¤ÏÍøÍѤ·¤Ê¤¤Êý¤¬Îɤ¤¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£ + # HTTPヘッダーのx-jphone-geocodeに位置情報が通知されます。 + # x-jphone-geocode: 354053%1A1394557%1A(住所がSJISでエ + # ンコードされたもの) "%1A"(SUB)で区切られて lat, lon, + # 住所(SJISでエンコード)の形式になります。住所はドキュ + # メントを見る限りSJISでエスケープしたものとなっていま + # すが、正しくデコードできない場合がありました。この情 + # 報は利用しない方が良いのかも知れません。 # see http://www.utilz.jp/wiki/Gps if($ci->is_softbank()){ my ($lat, $lon); @@ -204,15 +204,15 @@ $plugin = { return $view->render('location_receiver.html', $p); } - # see KDDI au: µ»½Ñ¾ðÊó > ´Ê°×°ÌÃÖ¾ðÊó + # see KDDI au: 技術情報 > 簡易位置情報 # http://www.au.kddi.com/ezfactory/tec/spec/eznavi.html if($ci->is_ezweb()){ - # au W53S location ¤ÎÌá¤êÎã + # au W53S location の戻り例 # 3/?datum=tokyo&unit=dms&lat=35.44.51.75&lon=139.35.15.0 - # au W53S gpsone ¤ÎÌá¤êÎã + # au W53S gpsone の戻り例 # /?ver=1&datum=0&unit=0&lat=%2b35.44.29.09&lon=%2b139.35.38.97&alt=71&time=20080114183222&smaj=116&smin=96&vert=46&majaa=24&fm=2 - $h{lat} =~ s/^%2b//i; # au GPSOne¤Î¾ì¹ç - $h{lon} =~ s/^%2b//i; # au GPSOne¤Î¾ì¹ç + $h{lat} =~ s/^%2b//i; # au GPSOneの場合 + $h{lon} =~ s/^%2b//i; # au GPSOneの場合 my ($wx, $wy) = (dms_to_degree($h{lat}), dms_to_degree($h{lon})); my ($tx, $ty) = wgs84_to_tokyo($wx, $wy); my $xml_code = get_rgeocode_xml($wx, $wy); diff --git a/lib/plugins/00nick b/lib/plugins/00nick index 0789f4a..f640304 100644 --- a/lib/plugins/00nick +++ b/lib/plugins/00nick @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00nick -# nickˆê—— -# $Id: 00nick,v 1.4 2008-06-29 07:55:01 morimoto Exp $ +# nick一覧 +# $Id: 00nick,v 1.5 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00nick,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/00postme b/lib/plugins/00postme index a1e03bb..8ba875d 100644 --- a/lib/plugins/00postme +++ b/lib/plugins/00postme @@ -1,6 +1,6 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00postme -# $Id: 00postme,v 1.4 2008-06-29 07:55:01 morimoto Exp $ +# $Id: 00postme,v 1.5 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00postme,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/00recent b/lib/plugins/00recent index 6d0d404..e1cddfc 100644 --- a/lib/plugins/00recent +++ b/lib/plugins/00recent @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00recent -# –¢“Ç”­Œ¾ˆê—— -# $Id: 00recent,v 1.7 2008-06-29 07:55:01 morimoto Exp $ +# 未読発言一覧 +# $Id: 00recent,v 1.8 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00recent,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/00topic b/lib/plugins/00topic index 5ee460d..c192934 100644 --- a/lib/plugins/00topic +++ b/lib/plugins/00topic @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00topic -# ƒgƒsƒbƒNˆê—— -# $Id: 00topic,v 1.4 2008-06-29 07:55:01 morimoto Exp $ +# トピック一覧 +# $Id: 00topic,v 1.5 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00topic,v $ # The line number (1 incremented) and filename below must be @@ -24,7 +24,7 @@ $plugin = { Encode::from_to($topic, $::cf->irc_charset(), $::cf->web_charset()); $topic = $::ib->simple_escape($topic); }else{ - $topic = '(ÄË߯¸–¢Ý’è)'; + $topic = '(トピック未設定)'; } $buf .= $topic; $buf .= "
\n"; diff --git a/lib/plugins/00unread b/lib/plugins/00unread index 94183e2..b0b7be7 100644 --- a/lib/plugins/00unread +++ b/lib/plugins/00unread @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/00unread -# ƒ`ƒƒƒlƒ‹‚Ì–¢“ǃƒbƒZ[ƒW‰{—— -# $Id: 00unread,v 1.7 2008-06-29 07:55:01 morimoto Exp $ +# チャネルの未読メッセージ閲覧 +# $Id: 00unread,v 1.8 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00unread,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/10url b/lib/plugins/10url index 90663d7..042cd3f 100644 --- a/lib/plugins/10url +++ b/lib/plugins/10url @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/10url -# URLˆ— -# $Id: 10url,v 1.6 2008-06-29 07:55:01 morimoto Exp $ +# URL処理 +# $Id: 10url,v 1.7 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/10url,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/11url_session b/lib/plugins/11url_session index 24494fc..b08b166 100644 --- a/lib/plugins/11url_session +++ b/lib/plugins/11url_session @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/11url_session -# URLˆ—(ƒZƒbƒVƒ‡ƒ“XV‚µ‚ăŠƒtƒ@ƒ‰‹t’T’m–hŒä) -# $Id: 11url_session,v 1.2 2008-06-29 07:55:01 morimoto Exp $ +# URL処理(セッション更新してリファラ逆探知防御) +# $Id: 11url_session,v 1.3 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/11url_session,v $ # The line number (1 incremented) and filename below must be @@ -15,7 +15,7 @@ $plugin = { my $ci = new Keitairc::ClientInfo($request); my $view = new Keitairc::View($::cf, $ci); - # V‚µ‚¢ session_id ‚ðì‚Á‚Č¢‚̂͏Á‚· + # 新しい session_id を作って古いのは消す $::sm->delete($session_id); my $new_session = $::sm->add($ci->{header}->{user_agent}, $ci->serial_key()); return $view->render('url_session.html', { diff --git a/lib/plugins/12keyword b/lib/plugins/12keyword index 6bc6d43..6405420 100644 --- a/lib/plugins/12keyword +++ b/lib/plugins/12keyword @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/12keyword -# Keywordˆ— -# $Id: 12keyword,v 1.3 2008-06-29 09:03:44 morimoto Exp $ +# Keyword処理 +# $Id: 12keyword,v 1.4 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/12keyword,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/20mail b/lib/plugins/20mail index 7ab2ad5..eeb7518 100644 --- a/lib/plugins/20mail +++ b/lib/plugins/20mail @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/20mail -# ƒ[ƒ‹ƒAƒhƒŒƒX -# $Id: 20mail,v 1.4 2008-06-29 07:55:01 morimoto Exp $ +# メールアドレス +# $Id: 20mail,v 1.5 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/20mail,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/20phone b/lib/plugins/20phone index 52055e3..3beeba6 100644 --- a/lib/plugins/20phone +++ b/lib/plugins/20phone @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/20phone -# “d˜b”ԍ† -# $Id: 20phone,v 1.5 2008-06-29 07:55:01 morimoto Exp $ +# 電話番号 +# $Id: 20phone,v 1.6 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/20phone,v $ # The line number (1 incremented) and filename below must be diff --git a/lib/plugins/30prefectures b/lib/plugins/30prefectures index ed235ed..43bf839 100644 --- a/lib/plugins/30prefectures +++ b/lib/plugins/30prefectures @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/30prefectures -# ¸©Ì¾¤«¤é»Ï¤Þ¤ëʸ»úÎó¤ò·ÈÂÓÈÇGoogle Map¤Ë¥ê¥ó¥¯ -# $Id: 30prefectures,v 1.3 2008-06-29 07:55:01 morimoto Exp $ +# 県名から始まる文字列を携帯版Google Mapにリンク +# $Id: 30prefectures,v 1.4 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/30prefectures,v $ # The line number (1 incremented) and filename below must be @@ -11,11 +11,10 @@ $plugin = { name => 'prefectures', - message_replace_regexp => '((?:Ë̳¤Æ»|µþÅÔÉÜ|ÂçºåÉÜ|ÅìµþÅÔ|ÀÄ¿¹¸©|´ä¼ê¸©|µÜ¾ë¸©|½©Åĸ©|»³·Á¸©|Ê¡Å縩|°ñ¾ë¸©|ÆÊÌÚ¸©|·²Çϸ©|ºë¶Ì¸©|ÀéÍÕ¸©|¿ÀÆàÀ|¿·³ã¸©|ÉÙ»³¸©|ÀÐÀ|Ê¡°æ¸©|»³Íü¸©|ĹÌ|´ôÉ츩|ÀŲ¬¸©|°¦Ãθ©|»°½Å¸©|¼¢²ì¸©|ʼ¸Ë¸©|ÆàÎɸ©|Ï²λ³¸©|Ä»¼è¸©|Å纬¸©|²¬»³¸©|¹­Å縩|»³¸ý¸©|ÆÁÅ縩|¹áÀ|°¦É²¸©|¹âÃθ©|Ê¡²¬¸©|º´²ì¸©|Ĺºê¸©|·§Ëܸ©|Âçʬ¸©|µÜºê¸©|¼¯»ùÅ縩|²­Æ츩)(?:.+)(?:»Ô|¶è|Ä®|·´|¼)(.*))', + message_replace_regexp => '((?:北海道|京都府|大阪府|東京都|青森県|岩手県|宮城県|秋田県|山形県|福島県|茨城県|栃木県|群馬県|埼玉県|千葉県|神奈川県|新潟県|富山県|石川県|福井県|山梨県|長野県|岐阜県|静岡県|愛知県|三重県|滋賀県|兵庫県|奈良県|和歌山県|鳥取県|島根県|岡山県|広島県|山口県|徳島県|香川県|愛媛県|高知県|福岡県|佐賀県|長崎県|熊本県|大分県|宮崎県|鹿児島県|沖縄県)(?:.+)(?:市|区|町|郡|村)(.*))', message_replace_imprementation => sub { my ($session_id, $str) = @_; - my $tmp = $str; - Encode::from_to($tmp, 'euc-jp', $::cf->web_charset()); + my $tmp = Encode::decode($::cf->web_charset(), $str); $tmp = ::uri_escape($tmp); return sprintf('%s', $::cf->web_root(), $session_id, $tmp, $str); diff --git a/lib/plugins/31distinct b/lib/plugins/31distinct index f775e09..11667dc 100644 --- a/lib/plugins/31distinct +++ b/lib/plugins/31distinct @@ -1,25 +1,24 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/31distinct -# ¶è̾¤«¤é»Ï¤Þ¤ëʸ»úÎó¤ò·ÈÂÓÈÇGoogle Map¤Ë¥ê¥ó¥¯ -# TODO: ÅìµþÅÔ¤·¤«¤Ï¤¤¤Ã¤Æ¤Ê¤¤¤è -# $Id: 31distinct,v 1.3 2008-06-29 07:55:01 morimoto Exp $ +# 区名から始まる文字列を携帯版Google Mapにリンク +# TODO: 東京都しかはいってないよ +# $Id: 31distinct,v 1.4 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/31distinct,v $ # The line number (1 incremented) and filename below must be # actual. see perlsyn. # line 11 "keitairc/lib/plugins/31distinct" -my $tokyo_special_wards = 'ÀéÂåÅĶè|Ãæ±û¶è|¹Á¶è|¿·½É¶è|ʸµþ¶è|ÂæÅì¶è|ËÏÅĶè|¹¾Åì¶è|ÉÊÀî¶è|Ìܹõ¶è|ÂçÅĶè|À¤ÅÄë¶è|½Âë¶è|ÃæÌî¶è|¿ùʶè|Ë­Åç¶è|Ë̶è|¹ÓÀî¶è|ÈĶ¶¶è|ÎýÇ϶è|­Ω¶è|³ë¾þ¶è|¹¾¸ÍÀî¶è'; -my $tokyo_cities = '¾¼Åç»Ô|¤¢¤­¤ëÌî»Ô|°ð¾ë»Ô|ÀÄÇß»Ô|À¶À¥»Ô|¹ñΩ»Ô|¾®¶â°æ»Ô|¹ñʬ»û»Ô|¾®Ê¿»Ô|¹ý¹¾»Ô|ΩÀî»Ô|¿Ëà»Ô|Ä´ÉÛ»Ô|À¾Åìµþ»Ô|Ȭ²¦»Ò»Ô|±©Â¼»Ô|Åìµ×αÊÆ»Ô|Åì¼»³»Ô|ÅìÂçÏ»Ô|ÆüÌî»Ô|ÉÜÃæ»Ô|Ê¡À¸»Ô|Ä®ÅÄ»Ô|»°Âë»Ô|Éð¢Ìî»Ô|É𢼻³»Ô'; +my $tokyo_special_wards = '千代田区|中央区|港区|新宿区|文京区|台東区|墨田区|江東区|品川区|目黒区|大田区|世田谷区|渋谷区|中野区|杉並区|豊島区|北区|荒川区|板橋区|練馬区|足立区|葛飾区|江戸川区'; +my $tokyo_cities = '昭島市|あきる野市|稲城市|青梅市|清瀬市|国立市|小金井市|国分寺市|小平市|狛江市|立川市|多摩市|調布市|西東京市|八王子市|羽村市|東久留米市|東村山市|東大和市|日野市|府中市|福生市|町田市|三鷹市|武蔵野市|武蔵村山市'; $plugin = { name => 'distinct', - message_replace_regexp => '((?:' . $tokyo_special_wards . '|' . $tokyo_cities . ')(?:.+)(?:[1-9]|°ì|Æó|»°|»Í|¸Þ|Ï»|¼·|Ȭ|¶å|¡»|¹æ|Ä®|»ú|ÈÖÃÏ))', + message_replace_regexp => '((?:' . $tokyo_special_wards . '|' . $tokyo_cities . ')(?:.+)(?:[1-9]|一|二|三|四|五|六|七|八|九|〇|号|町|字|番地))', message_replace_imprementation => sub { my ($session_id, $str) = @_; - my $tmp = $str; - Encode::from_to($tmp, 'euc-jp', $::cf->web_charset()); + my $tmp = Encode::decode($::cf->web_charset(), $str); $tmp = ::uri_escape($tmp); return sprintf('%s', $::cf->web_root(), $session_id, $tmp, $str); diff --git a/lib/plugins/32address b/lib/plugins/32address index 8ab351f..5725fca 100644 --- a/lib/plugins/32address +++ b/lib/plugins/32address @@ -1,7 +1,7 @@ -# -*-perl-*- +# -*- mode: perl; coding: utf-8 -*- # keitairc/lib/plugins/32address # -# $Id: 32address,v 1.2 2008-06-29 07:55:01 morimoto Exp $ +# $Id: 32address,v 1.3 2008-06-29 09:20:49 morimoto Exp $ # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/32address,v $ # The line number (1 incremented) and filename below must be -- 2.11.0