Tavis,
Sure, but the point was it wasn't clear if that is what you *want* or
what you *have*.
Neither. What I *want* is to send a GET followed by a string that can
again be split into its basic parts by a webserver. What I *have* is tho strings, one containing the URL path, and the other the arguments and/or fragment.
Umm.. I think that's obvious :)
As you asked for an "before encoding" example - which doesn't really exist -
I wasn't so sure about that anymore.
What I don't understand is why you can't show what specific input
you have that should produce the specific output above?
Perhaps that is because I have not yet found a function which will actually, you know, encode the whole URL ? :-p
What I showed is what I gathered what, from the information I googeled, the result of the encoding could/would look. I did that encoding by hand,
starting with
"/some part/another part?arg1=foo 42#brown&arg2=bar fly".
It's helpful that you showed the input you have, but again, it
would be helpful if you show the output you *wanted* too :)
Thats the wrong question.
Its not about what *I* want, but what the rules (whatever they are) decree
it should look like - so it can be broken up by the webserver into the exact same parts as provided by the client program.
But I'll try :
Input: "/some#part/other stuff?arg=my cat# a fragment"
Output: "/some?arg=my cat# a fragment#part/other stuff"
Expected output ? Either an error because a fragment cannot be part of the first part, or something like this : "/some%23part/other+stuff?arg=my+cat#+a+fragment"
Another example :
Input: "/part1#part2/part3#part4?arg1=data1#part5&arg2=data2#part6"
This one is problematic : how the <beep> do I know if that last "#part6" is
a fragment, or just a part of "arg2" ? I've not found anything even
wanting to touch tat question ...
But, other than just throwing an error because of ambiguity, there are at
least three outputs I can think of :
Naive:
"/part1%23part2/part3%23part4?arg1=data1%23part5&arg2=data2%23part6"
Making a guess: "/part1%23part2/part3%23part4?arg1=data1%23part5&arg2=data2#part6"
Fragment combining (a-la InternetCombineUrlA): "/part1/part3?arg1=data1&arg2=data2#part5#part4#part2#part6"
The first one will cause problems if the last part was actually ment as a fragment. In the same way, the second one causes a problem when it was ment
as part of "arg2". The same goes for the third one (the "#part2" could be
part of the folder name). Also, I've not seen any indication that multiple fragments are allowed or used anywhere.
The only solution I see is to provide the path, argument and fragment as seperate strings, so that all three can be encoded /before/ gluing them together (using their respective delimiters).
Is the URL already cracked, i.e. you know which part is a fragment
and a query?
I've been ninja-ed :-)
No, I do not *know*. But I do know that determining which is what is
already a problem ...
"InternetCrackUrl" doesn't seperate them either. Whatever is starting with
a "?" or "# is returned in the "extra" part.
By the way, FireFox doesn't really know either. When entering hash symbols
into the "input" boxes of an HTML "form" element the hash symbols get
percent encoded.
But put them into the "action" part, and everything starting from them will, for that part, just disappear.
The same happens when hash symbols are used in the URL bar - even though the URL bar does not reflect that throwing-away change. <whut?>
Damn .. It looked to be so easy, just finding the right function. :-)
Regards,
Rudy Wieser
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)