How to find out if string has already been URL encoded?

Decode, compare to original. If it does differ, original is encoded. If it doesn’t differ, original isn’t encoded. But still it says nothing about whether the newly decoded version isn’t still encoded. A good task for recursion.

I hope one can’t write a quine in urlencode, or this algorithm would get stuck.

Exception: When a string contains “+” character url decoder replaces it with a space even though the string is not url encoded

Leave a Comment