我需要使用Microsoft.XMLDOM在vbsrcript中获取XML的内容,这很好用,问题是XML的某些内容是希伯来语,它返回问号而不是希伯来字符
这是我的代码:
Function readXML(url) 'Reads XML and returns the xmldom document
if IsNull(XMLParser) Then
Set XMLParser = CreateObject("Microsoft.XMLDOM") 'XML object for loading and parsing
XMLParser.async = false
End If
dim pi
set pi = XMLParser.createProcessingInstruction("xml", " version='1.0' encoding='ISO-8859-1'")
XMLParser.appendChild(pi)
if XMLParser.Load(baseURL & url) then
Set readXML = XMLParser.documentElement
msgbox readXML.XML
Else
Msgbox "Error loading '" & url & "' data from Sport5.co.il " & chr(13) & "Please check connectivity",48
readXML = null
end if
End Function
Sub loadLeague(Sender)
Dim leagueDocRoot
set leagueDocRoot = readXML("495")
dim LeagueName
LeagueName = leagueDocRoot.selectSingleNode("Liga").selectSingleNode("Name").text
txtHeadline.Text = leagueName
End sub
如果我执行撤消操作并发布数据,则单词שלום显示为: 如何对收到的xml数据进行编码,以便我能正确显示?
TIA