From: Don Armstrong Date: Sat, 30 Dec 2017 19:29:15 +0000 (-0800) Subject: avoid reassigning to temp upon decode_utf8 X-Git-Url: https://git.donarmstrong.com/?p=infobot.git;a=commitdiff_plain;h=refs%2Fheads%2Fdpkg avoid reassigning to temp upon decode_utf8 - Failing to do causes $rhs/$lhs to be UTF8 decoded for some reason that I don't understand completely --- diff --git a/src/Factoids/Statement.pl b/src/Factoids/Statement.pl index b7cb0a7..1cc50cb 100644 --- a/src/Factoids/Statement.pl +++ b/src/Factoids/Statement.pl @@ -119,8 +119,8 @@ sub doStatement { # characters. ### this can be simplified. for my $temp ($lhs,$rhs ) { - $temp = decode_utf8($temp); - if ($temp =~ /([^[:print:]])/ or $temp =~ /\N{U+FFFD}/) { + my $temp2 = decode_utf8($temp); + if ($temp2 =~ /([^[:print:]])/ or $temp2 =~ /\N{U+FFFD}/) { &status("statement: illegal character '$1' ".ord($1)."."); &performAddressedReply( "i'm not going to learn illegal characters");