UrlEncode with specific encoding in Windows Phone 7?

In "regular" .NET, there is an UrlEncode method that takes an Encoding parameter. Is there such a UrlEncode method in .NET for WP7?

I am in Sweden and I am trying to get data from a REST service that expects ISO-8859-1 in requests (but responds in UTF-8). When doing a search ( input=frölunda) and just using UrlEncode, I get input=fr%C3%B6lundathat returns very strange results due to the ö "missing". Using .NET UrlDecode encoded with iso-8859-1, I get input=fr%F6lundaone that returns the expected results.

Do I need to run my own UrlEncode?

+5
source share
1 answer

Interestingly, Microsoft seems to be following the standard here with Silverlight. Wikipedia says:

[...] must convert all other characters to bytes in accordance with UTF-8 and then percent encoding of these values. This requirement was introduced in January 2005 with the publication of RFC 3986. URI schemes were introduced before this date are not affected.

So, it seems that they refused to choose the encoding, since in any case only one is allowed.

, . : , HtmlEncode. ( Uri.EscapeUriString HttpUtility.UrlEncode - .)

+2

All Articles