in reply to Re: excluding special characters when trying to print
in thread excluding special characters when trying to print

I would recommend this instead:
s/[[:^print:]]/_/g; # replace all unprintables with _