0

In a QueryString I have a part that looks like this

...u4w51EEcg8%2bj04e7C....

When I am using HttpUtility.UrlDecode the part "%2b" which represents a "+" just turns into a white space. I'm using HttpUtility.UrlEncode in the first place to encode the string.

Does anyone have any clue to what is going on?

2 Answers 2

1

Are you decoding twice? For convenience, a + sign in a URL decodes to (space, 0x20). While %2b should decode to +, decoding that will give you .

EDIT: Just saw your self-answer, and yeah, always check whether your getter functions / properties automatically decode for you. Double-decoding usually doesn't produce the desired result, and can even lead to security risks.

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

Comments

0

It looks like that "Request.QueryString[]" decodewhatever it gets, so what happened was that I decode the QueryString 2 times, which makes "+" a whitespace.

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.