0

I have a class in PHP that encodes this code "?�m�U", using urlencode(), resulting in "%3F%B6%16m%BEU". However, when I try to encode with c# uisng HttpUtility.UrlEncode(), the result is not the same. The method in c# has a second parameter "Encoding.SOMETHING". I've tried each one of the possible paramaters, but it still doesn't work.

Does anyone know how I can fix this?

1
  • 2
    What is ?�m�U supposed to represent (or is it an error in the submission of the question)? If it represents binary data, base64 encoding the data first might be a better option. Commented Jul 19, 2013 at 17:01

1 Answer 1

3

This one should work:

string utf8Encoded = System.Web.HttpUtility.UrlEncode(YOURURL, Encoding.UTF8);
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.