Solved

Convert a Perl CGI code to ASP

Posted on 2004-10-22
185 Views
Last Modified: 2013-12-25
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?
0
Question by:billson
    6 Comments
     
    LVL 13

    Accepted Solution

    by:
    0
     
    LVL 13

    Expert Comment

    by:StormyWaters
    Oh, I actually said this in the ASP version of this question as well, because I thought it hadn't gone through.
    0
     
    LVL 1

    Author Comment

    by:billson
    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
     
    LVL 13

    Expert Comment

    by:StormyWaters
    Not quite sure, I don't use VB too often. What output do you get?
    0
     
    LVL 1

    Author Comment

    by:billson
    If I input the Big5 Characters for input
    e.g. "中文 & Test", it returns "?? & Text" in WSH. But in ASP, it returns correctly.
    0
     
    LVL 13

    Expert Comment

    by:StormyWaters
    I'll look into it next time I'm in Windows. :)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Cisco Complete Network Certification Training

    If you’re an IT engineer or technician, it's time you take your career to the next level. This elite training bundle is brimming with all of the information you need to learn to sit for Cisco CNNA, CCNP, and CCENT certification exams.

    This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
    It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now