Search code examples
.netcompact-framework

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?


Solution

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

    More info on their differences.