From: timriker Date: Thu, 4 Mar 2010 01:18:55 +0000 (+0000) Subject: utf8 by default X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=106e9bcd5c2fa278a719abce24c65cae455ee8c8 utf8 by default git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1890 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/infobot b/infobot index e0c1ad2..2c58f39 100755 --- 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] ) { diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index 41d3ce2..6ac662e 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -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.