]> git.donarmstrong.com Git - infobot.git/commitdiff
upgrade to utf8 before checking for printable characters
authordondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 Dec 2011 17:47:23 +0000 (17:47 +0000)
committerdondelelcaro <dondelelcaro@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 17 Dec 2011 17:47:23 +0000 (17:47 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/don/dpkg@1911 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Statement.pl

index c80e3a4add88e8b46dc7c9d2c6bae92a329e5b34..d951bedb06ddb611e182353805cd24d3531652b2 100644 (file)
@@ -117,7 +117,8 @@ sub doStatement {
         # characters.
         ### this can be simplified.
         for my $temp ($lhs,$rhs ) {
-           if ($temp =~ /([^[:print:]])/) {
+           $temp = decode_utf8($temp);
+           if ($temp =~ /([^[:print:]])/ or $temp =~ /\N{U+FFFD}/) {
                &status("statement: illegal character '$1' ".ord($1).".");
                 &performAddressedReply(
                     "i'm not going to learn illegal characters");