0

Suppose one URL encodes a string.

urlencode(String1); => Becomes String2

Does successive url encoding on String2 create a string that is different from String 2?

meaning, urlencode(String2) == String2 ?

urlencode(String2) != String2 ?

1
  • 2
    Yes, if String1 contained characters that need encoding. Why not try out? Commented Jun 10, 2011 at 14:19

1 Answer 1

6

It certainly does create a different string, if the original string contained any non-alpha and non--_ character.

So, if the first urlencode encodes even one non-space, it will put a % in the resulting string as part of a %XX pattern. Subsequent urlencodes will re-encode that % (and start mangling your original string beyond recognition).

See it in action.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.