Linked Questions

Popular Questions

WP 7 - HttpWebRequest Encoding ISO-8859-2

Asked by At

I have this code:

    private void HandleWebResponse(IAsyncResult asyncResult)
    {
        WebRequestState state = (WebRequestState)asyncResult.AsyncState;

        HttpWebRequest request = state.Request;
        string url = request.RequestUri.ToString();
        state.Response = (HttpWebResponse)request.EndGetResponse(asyncResult);
        string absolutePath = state.Response.ResponseUri.AbsolutePath;


        if (state.Response != null)
        {
            StreamReader reader = new StreamReader(state.Response.GetResponseStream(),Encoding.GetEncoding("ISO-8859-1"));
            StringBuilder sb = new StringBuilder();
            while (!reader.EndOfStream)
                sb.Append(reader.ReadLine());
            ...

And I have web page with encoding ISO-8859-2, but WP7 doesn´t support this encoding. How can I convert this encoding to another? Or do you have tips how to bypass this problem? Thx for every advice.

Related Questions