2012-08-31 3 views
0

저는 다른 서버에서 rss 피드를 구문 분석하고 Repeater에 표시합니다. 그러나 오류가 있습니다 : 주어진 인코딩의 문자가 잘못되었습니다.rss 피드를 구문 분석 할 때 주어진 인코딩의 문자가 잘못되었습니다.

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load 
     'Create a WebRequest 
     Dim rssReq As WebRequest = WebRequest.Create("http://www.freelancer.com/rss/affiliatejob_mamboking_NET.xml") 
     'Create a Proxy 
     Dim px As New WebProxy("http://www.freelancer.com/rss/affiliatejob_mamboking_NET.xml", True) 
     'Assign the proxy to the WebRequest 
     rssReq.Proxy = px 
     'Set the timeout in Seconds for the WebRequest 
     rssReq.Timeout = 5000 
     Try 
      'Get the WebResponse 
      Dim rep As WebResponse = rssReq.GetResponse() 
      'Read the Response in a XMLTextReader 
      Dim xtr As New XmlTextReader(rep.GetResponseStream()) 
      'Create a new DataSet 
      Dim ds As New DataSet() 
      'Read the Response into the DataSet 
      ds.ReadXml(xtr) 
      'Bind the Results to the Repeater 
      rssFreelance.DataSource = ds.Tables(0) 
      rssFreelance.DataBind() 
     Catch ex As Exception 
      Throw ex 
     End Try 
    End Sub 

을 나는 그것이 쇼 UTF-8 인코딩 년대 XML의 소스를 볼 때 : 코드에 따라입니다.

<?xml version="1.0" encoding="utf-8"?> 
<?xml-stylesheet type="text/xsl" href="http://www.freelancer.com/content/rss.xsl" ?><rss version="2.0" xmlns:coop="http://www.google.com/coop/namespace"> 

답변

0
Imports System.Web 
WebUtility.HtmlDecode(response) 
응답 당신이 해독 할 실제 텍스트입니다

, 설명 또는 제목.

+0

이미 해결되었지만 어쨌든 감사드립니다. –

관련 문제