OSDN Git Service

Try to drop-off UTF8 flag (again).
authormatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sun, 11 May 2008 14:18:51 +0000 (14:18 +0000)
committermatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sun, 11 May 2008 14:18:51 +0000 (14:18 +0000)
I doubt if "if Encode::is_utf8($str)" is the right decision for that,
but it seems it works on some environment and no side effect in other
environment.

Submitted by: TAKAHASHI Yoshihiro

lib/plugins/00location_receiver

index 8dee786..4afab25 100644 (file)
@@ -2,7 +2,7 @@
 # keitairc/lib/plugins/00location_receiver
 # °ÌÃÖ¾ðÊóÁ÷¿®¡¢¤Î¥³¡¼¥ë¥Ð¥Ã¥¯
 #
 # keitairc/lib/plugins/00location_receiver
 # °ÌÃÖ¾ðÊóÁ÷¿®¡¢¤Î¥³¡¼¥ë¥Ð¥Ã¥¯
 #
-# $Id: 00location_receiver,v 1.8 2008-05-09 14:52:24 matusita Exp $
+# $Id: 00location_receiver,v 1.9 2008-05-11 14:18:51 matusita Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00location_receiver,v $
 
 use Net::HTTP;
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00location_receiver,v $
 
 use Net::HTTP;
@@ -148,6 +148,7 @@ $plugin = {
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
+                       Encode::_utf8_off($p->{address}) if Encode::is_utf8($p->{address});
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }
@@ -195,6 +196,7 @@ $plugin = {
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
+                       Encode::_utf8_off($p->{address}) if Encode::is_utf8($p->{address});
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }
@@ -231,6 +233,7 @@ $plugin = {
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
                        $p->{address} = $xml->{prefecture}->{pname} .
                                        $xml->{municipality}->{mname} .
                                        $xml->{local}->{section};
+                       Encode::_utf8_off($p->{address}) if Encode::is_utf8($p->{address});
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }
                        Encode::from_to($p->{address}, 'utf8', 'shiftjis');
                        return $view->render('location_receiver.html', $p);
                }