2
我已經編寫了visual basic 6代碼。它運行良好,但現在我用UTF-8和其他網站上的cyrilic發佈xml,看到不同的字符。我認爲,因爲我讀取和張貼xml作爲字符串。有沒有機會用utf-8發送它們?VB6通過HTTP發佈XML(UTF-8)
xmlContent()=fs.GetFileContent(Replace(Me.txtOutputFileName.Text, fs.GetFileNameByPath(Me.txtOutputFileName.Text), "") & xmlFileNames(i))
xmlString = MFunctions.GetString(xmlContent())
o.Open "POST", server, False, EE_XML_EXCHANGE_ID, EE_XML_EXCHANGE_PWD
o.setRequestHeader "Content-Type", "text/xml" ' "text/xml;charset=utf-8"
o.setRequestHeader "SOAPAction", ""
o.send xmlString
Me.txtResponseHeaders = o.getAllResponseHeaders
Me.txtResponse = o.responseText
謝謝
只要您使用正確的Content-Type,就應該按原樣工作。傳遞字符串時,.send()方法始終編碼爲UTF-8。爲什麼要使用我的超文本框,然後依賴默認屬性.Text?複製/粘貼代碼? – Bob77