[REBOL] URL handling
From: hallvard:ystad:helpinhand at: 21-Sep-2001 16:10
I'm dealing a bit with a URL that causes some trouble. Look at this:
>> print read
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&navn=&vej=&HUSN
R=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=S%F8g
** User Error: URL error:
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&nav
n=&vej=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=Søg
** Near: print read
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&navn=&vej
=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=Søg
>>
The error disappears if I remove the last parameter (S%F8g / Søg). The
error *also* disappears if I do a detour:
>> print read to-url
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&navn=&v
ej=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=S%F8g
But look at this:
>> print read to-url to-string
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVW
W&navn=&vej=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=S%F8g
** User Error: URL error:
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&nav
n=&vej=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=Søg
** Near: print read to-url to-string
http://krak.dk/scripts/firmaresultat.asp?pub_
id=KVWW&navn=&vej=&HUSNR=&POSTNR_FRA=&BY=&omraade=&tlf=&soegeord=&soeginfo=Søg
>>
So there's definitly something wrong with the reading of this value as a
url. But simply writing it to the rebol console creates no error:
>>
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&navn=&vej=&HUSNR=&POSTNR_F
RA=&BY=&omraade=&tlf=&soegeord=&soeginfo=S%F8g
==
http://krak.dk/scripts/firmaresultat.asp?pub_id=KVWW&navn=&vej=&HUSNR=&POSTNR_F
RA=&BY=&omraade=&tlf=&soegeord=&soeginfo=Søg
>>
..whereas deliberately writing a malformed URL does:
>> http:
** Script Error: http needs a value
** Near: http:
>>
So what's the deal about this URL? Why does the #"ø" cause problems?
~H