0

我有这个代码:

    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());
            ...

我有编码 ISO-8859-2 的网页,但 WP7 不支持这种编码。如何将此编码转换为另一种编码?或者你有提示如何绕过这个问题?谢谢你的每一个建议。

4

1 回答 1

1

只需使用Silverlight 编码生成器即可获得所需的编码!

于 2012-04-11T13:18:21.380 回答