Skip to content

Instantly share code, notes, and snippets.

@Aketzu
Created August 2, 2021 17:13
Show Gist options
  • Save Aketzu/b27443c595b90b09d277fbed356a54a0 to your computer and use it in GitHub Desktop.
Save Aketzu/b27443c595b90b09d277fbed356a54a0 to your computer and use it in GitHub Desktop.
# cleanzwsp.pl
#
# Cleans zero width spaces from text
#
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '1.00';
%IRSSI = (
authors => 'Anssi Kolehmainen',
contact => '[email protected]',
name => 'cleanzwsp',
description => 'Cleans zero-width spaces from text',
license => 'Public Domain',
url => 'http://aketzu.net',
changed => '2 August 2021 19:45:00',
);
sub cleanzwsp_message {
$_[1] =~ s/\x{200B}//g;
$_[1] =~ s/\xE2\x80\x8B//g;
Irssi::signal_continue(@_);
}
Irssi::signal_add('event privmsg', 'cleanzwsp_message');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment