Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can I use on .NET CF as a replacement for HttpUtility.UrlEncode

I need to move .NET code to the Compact Framework. That code uses HttpUtility.UrlEncode to encode query parameters, but System.Web isn't available on CF. What can I use instead?

like image 320
Martin Plante Avatar asked May 25 '09 19:05

Martin Plante


People also ask

What is UrlEncode in C#?

UrlEncode(String, Encoding) Encodes a URL string using the specified encoding object.

What is http utility?

HttpUtility is an open source MIT license project which is helpful in making HTTP requests and returns a decoded object from server.


1 Answers

Use Uri.EscapeDataString. It's nearly equivalent, and probably better anyway, and is included in NetCF.

More info on their differences.

like image 81
Andrew Arnott Avatar answered Oct 19 '22 04:10

Andrew Arnott