Thanks everyone. I am using "github.com/jlaffaye/ftp" library which returned unescaped file names when doing directory listing. I constructed the full url by doing
filePath = "ftp://user:pass@192.168.0.1/path/" + "file%ver3.txt <http://www.google.com/url?q=http%3A%2F%2Fuser%3Apass%40192.168.0.1%2Fpath%2Ffile%25ver3.txt&sa=D&sntz=1&usg=AFQjCNEltB9IG70yypPesqDd8Ib-f9lxFw>" and later tried to parse the url with url.Parse function somewhere else in the code which failed. I am now calling url.Escape on the file names before appending. Regards, Vivek On Thursday, 30 April 2020 22:35:45 UTC+5:30, Vivek wrote: > > I am trying to parse a url similar to "ftp:// > user:pass@192.168.0.1/path/file%ver3.txt > <http://www.google.com/url?q=http%3A%2F%2Fuser%3Apass%40192.168.0.1%2Fpath%2Ffile%25ver3.txt&sa=D&sntz=1&usg=AFQjCNEltB9IG70yypPesqDd8Ib-f9lxFw>" > > using `net/url` Parse function but I am getting a error > > `parse "ftp://user:pass@192.168.0.1/path/file%ver3.txt": invalid URL > escape "%ve"` > > https://play.golang.org/p/HE6zlDeIbyq > <https://play.golang.org/p/oJLwCJ4BUd0> > > The same path parses fine with python(urllib.parse.urlparse and C# URI). > > I appreciate any help on this. > > Regards, > Vivek > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a55c65be-fce0-43d7-95ea-2d33cb7746dc%40googlegroups.com.