Use Unicode::Normalize
[poe-component-irc-plugin-hello.git] / lib / POE / Component / IRC / Plugin / Hello.pm
index aa3380609bb82916ca4a87831311b8ac597eef29..f559fd2e7be9fe000f9dc2b59789ca07d6611423 100644 (file)
@@ -5,6 +5,7 @@ use strict;
 use warnings;
 use utf8;
 use Encode qw/encode decode/;
+use Unicode::Normalize qw/NFC/;
 
 our $VERSION = '0.001002';
 
@@ -21,8 +22,10 @@ sub new {
                           hola hey hi bonjour wassup sup hallo chikmaa
                           tungjatjeta parev salam namaskaar mingalarba ahoy
                           saluton allo moin aloha namaste shalom ciào ciao servus
-                          salve ave merhaba witaj hei hola selam sawubona/,
-                       "what's up", 'que tal', 'こんにちは', '你好', 'ni hao'],
+                          salve ave merhaba witaj hei hola selam sawubona
+                          geodemorgen hoi καλημέρα/,
+                       "what's up", 'que tal', 'こんにちは', '你好', 'ni hao',
+                       'добро јутро', 'γεια σας', 'bom dia', 'hyvää huomenta'],
                @_
        };
 
@@ -41,7 +44,7 @@ sub S_public{
        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;
This page took 0.009691 seconds and 4 git commands to generate.