Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search


 [1/9] from: D:Weyand:gmx at: 25-Feb-2005 10:42

Hi list, does anybody know a workaround to handle URIs with a escape character ^ like^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d&ignore=.csv within REBOL?
>> read^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d&ignore=.csv ** User Error: URL error:^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d&ign ore=.csv ** Near: read^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d&ignore=.csv I need your advice and help. Regards Dirk -- DSL Komplett von GMX +++ SupergŁnstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen:

 [2/9] from: SunandaDH:aol at: 25-Feb-2005 5:08

> does anybody know a workaround to handle URIs with a escape character ^ > like
escape it as %5E Keep it as a string until you need it: u: {} read to-url u == {Date,Open,High,Low,Close,Volume,Adj. Close* 24-Feb-05,10672.24,10779.39,10612.24,10748.79,15187500,10748.79 23-Feb-05,10609.28,... [snip] Sunanda.

 [3/9] from: D:Weyand:gmx at: 25-Feb-2005 11:56

Thanks Sunanda, :-) -- Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS GMX bietet bis zu 100 FreeSMS/Monat:

 [4/9] from: hallvard:ystad:oops-as:no at: 25-Feb-2005 12:50

Replace the "^" with "^^". You may want to look at my url-handler script: I'll put the "^^" trick into it shortly. HY Dixit Dirk Weyand (10.42 25.02.2005):

 [5/9] from: Izkata:Comcast at: 25-Feb-2005 6:00

Didn't work when I tried..... -Izzy Boy

 [6/9] from: hallvard:ystad:oops-as:no at: 25-Feb-2005 13:05

Thinking about it, this escaping needs to be done before you pass the string to the url-handler, so don't wait up for an update... HY Dixit Hallvard Ystad (12.50 25.02.2005):

 [7/9] from: hallvard:ystad:oops-as:no at: 25-Feb-2005 22:44

Sorry, my fault. You should, of course, replace the "^" with "%5E" ! Save the original URL to a file called "url" and then do this: a: read %url print read to-url replace/all a "^^" "%5E" Works overe here, should work fine for you too. HY Dixit Izkata (13.00 25.02.2005):
>Didn't work when I tried..... > -Izzy Boy
<<quoted lines omitted: 8>>
>> You may want to look at my url-handler script: >>

 [8/9] from: antonr:lexicon at: 26-Feb-2005 15:40

I don't see the need to save to and read from a file. You can do it all in memory, eg:
>> url:^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d &ignore=.csv ==^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d &ignore=.csv
>> url2: copy url
==^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d &ignore=.csv
>> replace/all url2 "^^" "%5E"
== =d&ignore=.csv
>> read url2
== {Date,Open,High,Low,Close,Volume,Adj. Close* 25-Feb-05,10748.42,10871.53,10698.32,10841.60,15236800,10841.60 24-Feb-05,10672.24,... Anton.

 [9/9] from: hallvard:ystad-oops:as:no at: 26-Feb-2005 13:16

Dixit Anton Rolls (05.40 26.02.2005):
>I don't see the need to save to and read from a file. >You can do it all in memory [...]
Of course. But make sure you don't serve to the rebol scanner a string that will be scanned before the URL is constructed. This is OK:
>> url:^DJI&a=1&b=26&c=2004&d=1&e==
>> url
===^DJI&a=1&b=26&c=2004&d=1&e== 25&f=2005&g=d&ignore=.csv But this is not:
>> url: to-url "^DJI&a=1&b=26&c=2004&d=1&e=25&f=2005&g=d&ignore=.csv" >> url
=== The reason is that rebol has found "^D" to be %04 instead of #"^" alone to be %5E. You need to replace #"^" before the rebol scanner gets a chance to find it. Maybe this is worth a mention to RT feedback? Maybe 'read should be able to fix #"^" on its own? HY

  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted