Gossamer Forum
Home : General : Perl Programming :

nonprintable characters

Quote Reply
nonprintable characters
another email issue! i have my form set up to reject if email message is less than a certain number of characters. i am receiving emails in which the message appears empty but contains nonprintable characters. how can i test for this and remove the nonprintable characters from the message. here's the parse sub:
Code:
sub parse_form {
# --------------------------------------------------------
my (%in);
my ($buffer, $pair, $name, $value,$s);
PAIR: foreach $name ($query->param()) {
@value = $query->param("$name");
$value = join '~~', @value;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$value =~ tr/+/ /;
if ($value eq "---") { next PAIR; }
if ($value eq "http://") { next PAIR; } # Removes default beginning of URLs
unless ($value =~ /\S+/) { next PAIR; } # 01/29/2017

$in{$name} = $value;
}
return %in;
}
Subject Author Views Date
Thread nonprintable characters delicia 3408 Mar 2, 2021, 1:04 PM
Thread Re: [delicia] nonprintable characters
delicia 3374 Mar 3, 2021, 7:53 AM
Thread Re: [delicia] nonprintable characters
Andy 3370 Mar 3, 2021, 8:24 AM
Thread Re: [Andy] nonprintable characters
delicia 3362 Mar 3, 2021, 8:55 AM
Thread Re: [delicia] nonprintable characters
Andy 3357 Mar 3, 2021, 9:16 AM
Thread Re: [Andy] nonprintable characters
delicia 3352 Mar 3, 2021, 10:05 AM
Thread Re: [delicia] nonprintable characters
delicia 3346 Mar 3, 2021, 10:15 AM
Post Re: [delicia] nonprintable characters
Andy 3334 Mar 3, 2021, 11:14 AM