SANJIESAN TOOLS / Link construction
Preserve a plus sign when building a search link
A resource called Brush+Paper should not silently become Brush Paper when a search link is built. Query strings have encoding rules, and a visible plus sign can have a different role from a literal plus inside a value. Use a harmless resource label to check the complete build-and-read route before sharing generated links.
Write the raw expected value
Prepare a short set containing a space, a literal plus and an ampersand, with the exact decoded value expected for each. Keep those values separate from the final URL. MDN documents URLSearchParams as interpreting plus signs in a parsed query string as spaces. That narrow behaviour is a reason to use the documented parameter-building route, not to manually replace every plus in an existing link whose origin you do not understand.
Use one encoding boundary deliberately
Read the API’s current instructions for supplying individual keys and values and for serialising the result. Avoid interpolating raw values into a query string and then hoping the parser reconstructs them. Also avoid pre-encoding a value without checking whether the chosen API will encode it again. Keep parameter construction distinct from the full URL’s origin and path. A correct query does not make an unintended external destination appropriate.
Compare decoded values, not only URL spelling
For each harmless sample, inspect the parameter received through the intended route and compare it with the original value. Check that an ampersand inside a resource name did not become an extra parameter. Record the method and any untested destination behaviour. Keep personal or secret information out of public links and logs. No link generator was executed for this article; its diagnostic set makes an encoding mistake visible before it reaches a real resource catalogue.