Encode spaces in URL path
See original GitHub issueDescribe the bug Sometimes the query string is not encoded and it comes spaces within, for instance: “https://example.org/find?q=foo bar baz”. Therefore a DDG search is made, instead of opening the site directly.
Expected behavior
Be able to detect if the string matches some url pattern, and if so, replace those spaces with %20
string, in order to go to specific url.
Smartphone (please complete the following information):
- DDG App Version: 5.87.0
- OS: Android
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
URL encoding the space character: + or %20? - Stack Overflow
For HTTP URLs, a space in a path fragment part has to be encoded to "%20" (not, absolutely not "+"), while the "+"...
Read more >Spaces and Uppercase characters in URLs - SISTRIX
Depending on the position of the spaces in a URL, different rules apply with regard to how those spaces are properly encoded. Uppercase...
Read more >How to fix URL contains whitespace issue - Sitechecker
URL encoding simply doesn't allow spaces. A space is considered unsafe and makes a URL invalid. That's why whitespace is used instead. In...
Read more >Spaces in Link and Image URL/URI (HTML Encoding) - Arclab
URLs use the ASCII charset. URL encoding replaces space characters with "%20" (percent followed by the ASCII code for a blank space).
Read more >URL contains whitespace - Sitebulb
This means that the URL in question contains whitespace characters in the path. URLs with whitespace characters are not recommended as they could...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok, gotcha. Good to know that it happens when opening external links. Thanks. Will investigate the issue 👍
Haven’t you able to open an external link with spaces? For instance, a wikipedia article served from apps who doesn’t encode properly the urls, for instance: “https://en.wikipedia.org/wiki/Medina del Campo”
As you can see the url is bad parsed, but if you c&p the whole link the application should be able to replace such blank spaces with
%20
characters. As simple as that.