Poor Monzo.me URL Escaping

Incidentally, that’s a good illustration why I don’t like w3schools. It completely overlooks a very important aspect: + is only valid to encode a [space] in the query part of the URL (the part after the ?). For the rest of the URL the only valid encoding for a [space] is %20 (which is also valid for the query part). They should really point this out.

So:

  • example.com/test.html?foo=bar1+bar2: The value of foo is bar1 bar2 ([space] between bar1 and bar2)
  • example.com/test.html?foo=bar1%20bar2: is identical to the above.
  • example.com/test%20file.html: Will request the file test file.html ([space] between test and file)
  • example.com/test+file.html: Will request the file test+file.html (+ between test and file)

(It should be noted, though, that + is perfectly valid for the query part, and Monzo should decode it properly.)

4 Likes