Aharon Manne
Aharon Manne

Reputation: 712

HttpUtility.HtmlEncode not working

I am trying to encode parameters to be sent to a web service for processing. I start with a command with parameters such as:

TransportProviderConfirmation/68,Akal Singh,+972544944860,1234

I pass this string to a the encoding function:

template = HttpUtility.HtmlEncode(template);

The returned string is not changed in any way, despite the fact that there is a blank space which should be turned into %20, and a plus sign which should be turned into %2B. What is happening?

Upvotes: 2

Views: 3856

Answers (1)

Erik Philips
Erik Philips

Reputation: 54618

HtmlEncode? I think you're looking for UrlEncode().

Upvotes: 9

Related Questions