Convert a Perl CGI code to ASP

I need to convert a Perl CGI script to ASP vb script, becuase I require to convert the data into my ASP program. and I have no idea about the CGI.

This is the CGI script

sub dc_decode {
    my $todecode = shift;
    return undef unless defined($todecode);
    $todecode =~ tr/+/ /;       # pluses become spaces
    $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
    $todecode =~ s/\r\n/\n/g;;
    return $todecode;
}

Do anyone know the ASP version of the above script?
LVL 1
billsonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
StormyWatersCommented:
Oh, I actually said this in the ASP version of this question as well, because I thought it hadn't gone through.
0
 
billsonAuthor Commented:
thx StormyWaters, the return code is correctly display in ASP page, but if I use Windows Script Hosting - vbs file to get the output. the return code is mess-up. Any idea?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
StormyWatersCommented:
Not quite sure, I don't use VB too often. What output do you get?
0
 
billsonAuthor Commented:
If I input the Big5 Characters for input
e.g. "中文 & Test", it returns "?? & Text" in WSH. But in ASP, it returns correctly.
0
 
StormyWatersCommented:
I'll look into it next time I'm in Windows. :)
0
All Courses

From novice to tech pro — start learning today.