I sure hope Irssi on Windows accepts scripts written in Perl. If this is the case, here's the solution:
use strict;
use warnings;
our $VERSION = "1.0";
our %IRSSI = ();
# interception made by registering signal as first + Irssi::signal_continue()
sub event_ctcp_dccsend {
my ($server, $args, $nick, $addr, $target) = @_;
# split incomming send request args into filename (either before first space or
# quoted), and the rest (IP, port, +optionally filesize)
my ($filename, $rest) = $args =~ /((?:".*")|\S*)\s+(.*)/;
# remember file name for informing sake
my $oldname = $filename;
# replace backslashes with "BSL" (change to anything you wish)
if ($filename =~ s/\\/BSL/g) {
# some info for user
Irssi::print('DCC SEND request from '.$nick.': renamed bad filename '.$oldname.' to '.$filename);
$args = $filename." ".$rest;
# propagate signal; Irssi will proceed the request with altered arguments ($args)
Irssi::signal_continue($server, $args, $nick, $addr, $target);
}
}
# register signal of incoming ctcp 'DCC SEND', before anything else
Irssi::signal_add_first('ctcp msg dcc send', 'event_ctcp_dccsend');
The script intercepts "DCC SEND" ctcp messages and replaces all backslashes in the filename into "BSL" string, then forwards altered arguments of message to any other scripts and Irssi.
If you want to remove all "\uXXXX" instead, use s/\\u\w{4}//g
in place of s/\\/BSL/g
I hope it helps!