473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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=antwerpen&when=&starti ngPageNumber=1&stageName=What%20search&originalOff set=1&expandWWWSearch=false&myplaces=false&activeR efinements=locality4..%3D..Antwerpen..%26..Antwerp en&distance=0&searchType=www&activeSort=-beyprandom1%20-beboost%20-boost3&phoneNumberSearch=false&debug=&excludeZone= false&alphaRefineable=AY52%7CBN18%7CCN30%7CDN53%7C EN10%7CFN16%7CGN10%7CHN56%7CIN9%7CJN3%7CKN10%7CLN8 %7CMN23%7CNN7%7CON7%7CPN13%7CQN1%7CRN10%7CSN19%7CT N29%7CUN0%7CVN26%7CWN5%7CXN0%7CYN0%7CZN1%7C%5B0-9%5DN0&headingNumber=&adtype=xml.click&partnerId=& mfinfo.partner_id=&encodedRefinement=heading..%3D. .%5EKoffiezetmachines%24..%26..Koffiezetmachines

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

Sep 19 '06 #1
1 4550
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=antwerpen&when=&starti ngPageNumber=1&stageName=What%20search&originalOff set=1&expandWWWSearch=false&myplaces=false&activeR efinements=locality4..%3D..Antwerpen..%26..Antwerp en&distance=0&searchType=www&activeSort=-beyprandom1%20-beboost%20-boost3&phoneNumberSearch=false&debug=&excludeZone= false&alphaRefineable=AY52%7CBN18%7CCN30%7CDN53%7C EN10%7CFN16%7CGN10%7CHN56%7CIN9%7CJN3%7CKN10%7CLN8 %7CMN23%7CNN7%7CON7%7CPN13%7CQN1%7CRN10%7CSN19%7CT N29%7CUN0%7CVN26%7CWN5%7CXN0%7CYN0%7CZN1%7C%5B0-9%5DN0&headingNumber=&adtype=xml.click&partnerId=& mfinfo.partner_id=&encodedRefinement=heading..%3D. .%5EKoffiezetmachines%24..%26..Koffiezetmachines

(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.
js*******@attglobal.net
==================
Sep 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Junkmail | last post by:
I have an application with highly compressable strings (gzip encoding usually does somewhere between 20-50X reduction.) My base 350MB database is mostly made up of these slowly (or even static)...
17
by: Olivier Bellemare | last post by:
I've tried to make a function that returns the middle of a string. For example: strmid("this is a text",6,4); would return "is a". Here is my code: char *strmid(char *texte, int depart,...
51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
35
by: Cor | last post by:
Hallo, I have promised Jay B yesterday to do some tests. The subject was a string evaluation that Jon had send in. Jay B was in doubt what was better because there was a discussion in the C#...
8
by: ais523 | last post by:
I use this function that I wrote for inputting strings. It's meant to return a pointer to mallocated memory holding one input string, or 0 on error. (Personally, I prefer to use 0 to NULL when...
2
by: Alex | last post by:
Is there an easy way to encode in javascript a string to another string that would have HTML safe characters like & to $amp; and such?
11
by: Dustan | last post by:
Is there any builtin function or module with a function similar to my made-up, not-written deformat function as follows? I can't imagine it would be too easy to write, but possible... 'I am...
111
by: Tonio Cartonio | last post by:
I have to read characters from stdin and save them in a string. The problem is that I don't know how much characters will be read. Francesco -- ------------------------------------- ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.