Compressing a string with URL safe characters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gerry Vandermaesen

    Compressing a string with URL safe characters

    Hi all,

    What would be the best way to encode and optimally also compress a long
    string with URL unsafe characters to be passed as a GET parameter?

    Example string:

    /search.ds?&what =hotel&where=an twerpen&when=&s tartingPageNumb er=1&stageName= What%20search&o riginalOffset=1 &expandWWWSearc h=false&myplace s=false&activeR efinements=loca lity4..%3D..Ant werpen..%26..An twerpen&distanc e=0&searchType= www&activeSort=-beyprandom1%20-beboost%20-boost3&phoneNum berSearch=false &debug=&exclude Zone=false&alph aRefineable=AY5 2%7CBN18%7CCN30 %7CDN53%7CEN10% 7CFN16%7CGN10%7 CHN56%7CIN9%7CJ N3%7CKN10%7CLN8 %7CMN23%7CNN7%7 CON7%7CPN13%7CQ N1%7CRN10%7CSN1 9%7CTN29%7CUN0% 7CVN26%7CWN5%7C XN0%7CYN0%7CZN1 %7C%5B0-9%5DN0&headingN umber=&adtype=x ml.click&partne rId=&mfinfo.par tner_id=&encode dRefinement=hea ding..%3D..%5EK offiezetmachine s%24..%26..Koff iezetmachines

    (yes I know the example is an URL itself, but I need the entire string
    to be passed as a GET parameter)

  • Jerry Stuckle

    #2
    Re: Compressing a string with URL safe characters

    Gerry Vandermaesen wrote:
    Hi all,
    >
    What would be the best way to encode and optimally also compress a long
    string with URL unsafe characters to be passed as a GET parameter?
    >
    Example string:
    >
    /search.ds?&what =hotel&where=an twerpen&when=&s tartingPageNumb er=1&stageName= What%20search&o riginalOffset=1 &expandWWWSearc h=false&myplace s=false&activeR efinements=loca lity4..%3D..Ant werpen..%26..An twerpen&distanc e=0&searchType= www&activeSort=-beyprandom1%20-beboost%20-boost3&phoneNum berSearch=false &debug=&exclude Zone=false&alph aRefineable=AY5 2%7CBN18%7CCN30 %7CDN53%7CEN10% 7CFN16%7CGN10%7 CHN56%7CIN9%7CJ N3%7CKN10%7CLN8 %7CMN23%7CNN7%7 CON7%7CPN13%7CQ N1%7CRN10%7CSN1 9%7CTN29%7CUN0% 7CVN26%7CWN5%7C XN0%7CYN0%7CZN1 %7C%5B0-9%5DN0&headingN umber=&adtype=x ml.click&partne rId=&mfinfo.par tner_id=&encode dRefinement=hea ding..%3D..%5EK offiezetmachine s%24..%26..Koff iezetmachines
    >
    (yes I know the example is an URL itself, but I need the entire string
    to be passed as a GET parameter)
    >
    Uh... maybe urlencode()?

    Also, don't know what you mean by "compress". Compressing something
    typically gives non-alphanumeric chars. Then making those URL-safe
    would require replacing them with 3-4 chars such as %148. Somewhat a
    losing proposition.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    Working...