Problem reading url
[1/5] from: raimunddold:web at: 18-Apr-2004 16:01
Hi,
I try to read an URL which contains an ^. But this always fails:
>> URL: to-url {http://de.finance.yahoo.com/d/quotes/
csv?s=^GDAXI&f=sl1t1d1c1pohgv}
== http://de.finance.yahoo.com/d/quotes/csv?s=%07DAXI&f=sl1t1d1c1pohgv
>> read URL
** User Error: URL error: http://de.finance.yahoo.com/d/quotes/
csv?s=DAXI&f=sl1t1d1c1pohgv
** Near: read URL
>>
Omitting the "^" works but is obviously not the correct URL. Is this a bug or
a feature?
Raimund
[2/5] from: antonr:lexicon at: 19-Apr-2004 2:08
Just having a look in net-utils/url-parser ...
write clipboard:// mold net-utils/url-parser
Just used this tool:
http://www.w3schools.com/html/html_ref_urlencode.asp
which encodes your url thus:
http%3A%2F%2Fde%2Efinance%2Eyahoo%2Ecom%2Fd%2Fquotes%2Fcsv%3Fs%3D%5EGDAXI%26
f%3Dsl1t1d1c1pohgv%0D%0A
Notice the %3D%5E, which looks like the encoding for ^
If I replace the ^ with %3D%5E, then I can read the url ok.
Not sure what this means for rebol's url-parser.
Anton.
[3/5] from: Gary:Jones:usap:gov at: 19-Apr-2004 11:36
Raimund,
REBOL generally follows the accepted standard for url characters; however, frequently
websites use characters that are not technically part of the standard. I have not checked
for "^".
At any rate the net-utils parsing rules *sometimes* can be patched to allow the url to
be parsed. I have tried the patch for this character and it appears to parse, but I
do not know if it retrieves the information for which you seek. Watch for line wrap.
net-utils/url-parser/path-char: union net-utils/url-parser/path-char make bitset! "^^"
read http://de.finance.yahoo.com/d/quotes/csv?s=^GDAXI&f=sl1t1d1c1pohgv
yields:
connecting to: de.finance.yahoo.com
== {^^GDAXI;4033,98;17:45;4/16/2004;+29,37;4004,61;4004,61;4043,53;3986,62;0
}
This patch may make other tcp accesses unstable, so use at your own risk, or alternatively:
old-bitset: copy net-utils/url-parser/path-char
net-utils/url-parser/path-char: union net-utils/url-parser/path-char make bitset! "^^"
read http://de.finance.yahoo.com/d/quotes/csv?s=^GDAXI&f=sl1t1d1c1pohgv
net-utils/url-parser/path-char: copy old-bitset
which then reverts the bitset back to the original.
Hope that this helps as an alternative to Anton's more properly formatted method.
--Scott Jones
[4/5] from: antonr::lexicon::net at: 20-Apr-2004 1:08
Actually %3D%5E is the encoding for two characters =^
So just replace ^ with %5E
Anton.
[5/5] from: raimunddold:web at: 19-Apr-2004 21:05
Am Montag, 19. April 2004 17:08 schrieben Sie:
> Actually %3D%5E is the encoding for two characters =^
> So just replace ^ with %5E
>
Thanx, for the answer.
Raimund