]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Fix UTF-8 encoding problem
authorThomas B. Ruecker <redacted>
Tue, 30 Jun 2015 12:01:33 +0000 (12:01 +0000)
committerThomas B. Ruecker <redacted>
Tue, 30 Jun 2015 12:01:33 +0000 (12:01 +0000)
scripts/mqtt-notify.pl

index 202d964e0714586b4381c5f4546c21d67813bf75..f389f453bed7b570ef93e719b8f13b28feba8654 100644 (file)
@@ -124,8 +124,8 @@ sub sig_message_private ($$$$) {
   if ((Irssi::settings_get_bool('mqtt_reveal_privmsg'))) {
     $body = '(PM: '.$nick.")\n".$data;
   }
-  utf8::decode($body);
   $body = Irssi::strip_codes($body);
+  utf8::decode($body);
   my @message_args = @args;
   push(@message_args, "-m", $body);
   mosquitto_pub(@message_args);
@@ -138,8 +138,8 @@ sub sig_print_text ($$$) {
 
   if ($dest->{level} & MSGLEVEL_HILIGHT) {
     my $body = '['.$dest->{target}."]\n".$stripped;
-    utf8::decode($body);
     $body = Irssi::strip_codes($body);
+    utf8::decode($body);
     my @message_args = @args;
     push(@message_args, "-m", $body);
     mosquitto_pub(@message_args);
@@ -173,8 +173,8 @@ sub sig_message_topic {
   my($server, $channel, $topic, $nick, $address) = @_;
 
   my $body = 'Topic for '.$channel."\n".$topic;
-  utf8::decode($body);
   $body = Irssi::strip_codes($body);
+  utf8::decode($body);
   my @message_args = @args;
   push(@message_args, "-m", $body);
   mosquitto_pub(@message_args);
git clone https://git.99rst.org/PROJECT