]> git.donarmstrong.com Git - infobot.git/commitdiff
utf8 by default
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Mar 2010 01:18:55 +0000 (01:18 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Mar 2010 01:18:55 +0000 (01:18 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1890 c11ca15a-4712-0410-83d8-924469b57eb5

infobot
src/IRC/Irc.pl

diff --git a/infobot b/infobot
index e0c1ad20d65ad887036212802e8f4a60e2b1078f..2c58f3921cb7e3d493e96eb1f357d711d0d2f279 100755 (executable)
--- a/infobot
+++ b/infobot
@@ -11,6 +11,10 @@ use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
   $bot_pid $memusage %param
 );
 
+# ancient Perl may not like these, but modern systems should have this
+use open ':utf8';
+use open ':std';
+
 BEGIN {
     if ( @ARGV and -f $ARGV[0] ) {
 
index 41d3ce292aa2d131d06fc7e1fd48b5eb382b6f99..6ac662e3a7d9c958ba0cf5ddb6966ada09f1bedb 100644 (file)
@@ -19,9 +19,6 @@ use vars qw($notcount $nottime $notsize $msgcount $msgtime $msgsize
 use vars qw($b_blue $ob);
 use vars qw(@ircServers);
 
-#use open ':utf8';
-#use open ':std';
-
 $nickserv = 0;
 
 # It's probably closer to 510, but let's be cautious until we calculate it extensively.
@@ -128,6 +125,9 @@ sub irc {
                &ERROR('If this is still a problem, please contact the maintainer.');
            }
            if (defined $conns{$mynick}) {
+               # explicit binmode for socket as "use open" does not seem to work here
+               binmode $conns{$mynick}->{_socket}, ":utf8";
+
                $conns{$mynick}->maxlinelen($maxlinelen);
 
                # handler stuff.