use warnings;
use utf8;
use Encode qw/encode decode/;
+use Unicode::Normalize qw/NFC/;
our $VERSION = '0.001002';
my ($self, $irc, $rfullname, $rchannels, $rmessage) = @_;
my $nick = parse_user $$rfullname;
my $mynick = $irc->nick_name;
- my $message = decode 'UTF-8', $$rmessage;
+ my $message = NFC decode 'UTF-8', $$rmessage;
my @hello = @{$self->{greetings}};
my $match = first { $message =~ /^\s*(?:$mynick(?:)[:,])?\s*$_\s*[.!]?\s*$/i } @hello;
use strict;
use warnings;
-use Test::More tests => 18;
+use Test::More tests => 19;
use Test::MockObject;
BEGIN { use_ok('POE::Component::IRC::Plugin::Hello') };
runtest 'namaste', 1, 'namaste';
runtest 'neaţa', 1, 'neaţa (UTF-8 test)';
runtest 'こんにちは', 1, 'こんにちは (another UTF-8 test)';
+runtest 'neața', 1, 'neața (UTF-8 with combining comma below)';
runtest 'salu', 0, 'salu (misspelling)';
runtest 'hii', 0, 'hii (misspelling)';