open escapes # when there are spaces in the URL
martin-braun opened this issue · 4 comments
martin-braun commented
open("https://google.com#test 123");
will open https://google.com%23test%20123
when it should open https://google.com#test%20123
. Edgy case, but threw me off.
Would be nice if this would be fixed for the next poor guy searching for a way to disable escaping.
sindresorhus commented
What operating system?
martin-braun commented
@sindresorhus Sorry, forgot to mention.
macOS 12.1 (21C52)
sindresorhus commented
Looking closer at this, it's working as expected. Unescaped space is not valid in an URL.
The native open
also works this way:
command open 'https://google.com#test 123'
martin-braun commented
Well that's interesting. I thought I spotted a bug, but yes, it is no valid URL anyways. Well then it's fine I guess.
Thanks for looking into it.