E
Eric
Hi,
I need to convert a string into a HTML encoded hex equivalent. I'm trying
things along the lines of:
________________________________________________
my $message = 'This is a message with various characters in it.';
my $encmsg = '';
for (my $i=0; $i<length($message); $i++)
{
$encmsg .= "%" . ord(substr($message, $i, 1));
}
print $encmsg;
________________________________________________
But this is producing decimal codes instead of hex ones.
Is there a better way to do this, that works?
Thanks,
Eric
I need to convert a string into a HTML encoded hex equivalent. I'm trying
things along the lines of:
________________________________________________
my $message = 'This is a message with various characters in it.';
my $encmsg = '';
for (my $i=0; $i<length($message); $i++)
{
$encmsg .= "%" . ord(substr($message, $i, 1));
}
print $encmsg;
________________________________________________
But this is producing decimal codes instead of hex ones.
Is there a better way to do this, that works?
Thanks,
Eric