cage1016 / alfred-devtoys

A Swiss Army knife for developers for Alfred
MIT License
118 stars 6 forks source link

URL encode doesn't encode all characters #14

Open contentfree opened 1 year ago

contentfree commented 1 year ago

I'm trying to encode "this & that" and it's produces this%20&%20that instead of this%20%26%20that

devnoname120 commented 1 year ago

DevToys shows the output of PathEscape() rather than JavaScript's encodeURIComponent() which doesn't exist in Golang. Ideally it should display both outputs, but that's a feature suggestion rather than a bug.

encodeURI(): this%20&%20that
encodeURIComponent(): this%20%26%20that

See:

contentfree commented 1 year ago

Just ran into this again when trying to run encode success=true. The expected output is success%3Dtrue but DevToys gives success=true

contentfree commented 1 year ago

Wild that you responded eight hours ago after months and I just coincidentally ran into the problem again today. The universe is weird!

devnoname120 commented 1 year ago

My code in the go.dev link also works on this example. I will submit a PR later :)

JeasonKim commented 11 months ago

My code in the go.dev link also works on this example. I will submit a PR later :)

Have you completed the pull request for this feature?

devnoname120 commented 11 months ago

I haven't. I have other priorities right now.