Search code examples
urlescapingrebolrebol2

Escape symbols in Rebol url


I am using Rebol 2.7.8.3.1. I am trying to escape an @ symbol in my url, but it is not working. I have also tried manually escaping it, but that does not work either.

I have tried the following:

read ftp://mydomain:12345/path/to/@folderA
read ftp://mydomain:12345/path/to/%40folderA

If I have a folder, folderB (no @ in path), it works fine:

read ftp://mydomain:12345/path/to/folderB

I have also tried writing the url as a string, both unescaped and not, and then used to-url, but it gives similar results.

Using decode-url, it seems like Rebol misinterprets the url in all my cases.

How do I escape urls in Rebol?


Solution

  • You can try this variation

    read [
    scheme: 'ftp
     host: "mydomain"
     port-id: 12345
     path: "path/to/"
     target: "@folderA"
    ]
    

    in order to make it complete you can use

    read [
     scheme: 'ftp
     host: "mydomain"
     port-id: 12345
     user: ask "user? "
     pass: ask/hide "password? "
     path: "path/to/"
     target: "@folderA"
    ]