We have discovered a problem whereby a UTF-8 include file is causing the ANSI file it is included in to become UTF-8.
Is there any reason for the include file to be UTF-8 or can it be safely changed to ANSI?
When I have tried changing it nothing obvious has broken, however the include file contains functions that are related to interactions with a web service.
I include the code of the include file:
<%
Function GetQuotedUrl(ByVal value)
GetQuotedUrl = Chr(34) & value & Chr(34)
End Function
Function GetServiceResponse(ByVal paramArr,ByVal methodName)
dim soapMessage
dim responseMessage
soapMessage=CreateSOAPMessage(paramArr,methodName)
soapMessage = Replace(soapMessage, "'", chr(34))
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", SERVICE_URL , False
xmlhttp.setTimeouts 30000, 60000, 30000, 120000
xmlhttp.setRequestHeader "Man", POST & " " & SERVICE_URL & " HTTP/1.1"
xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/" & SERVICE_CONTRACT & "/" & methodName
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.send(soapMessage)
responseMessage=xmlhttp.responseText
GetServiceResponse=responseMessage
End Function
Function CreateSOAPMessage(ByVal paramArr,ByVal methodName)
dim soapMessage
dim param
dim paramName,paramValue
dim paramNameValue
For count=0 to UBound(paramArr)-1
paramNameValue=Split(paramArr(count),"=")
param = param & "<" & paramNameValue(0) & ">" & paramNameValue(1) & "</" & paramNameValue(0) & ">"
Next
soapMessage = "<s:Envelope xmlns:s=" & GetQuotedUrl("http://schemas.xmlsoap.org/soap/envelope/") & ">" & _
"<s:Body>" & _
"<" & methodName & " xmlns=" & GetQuotedUrl("http://tempuri.org/") & ">" & param & "</" & methodName & ">" & _
"</s:Body>" & _
"</s:Envelope>"
CreateSOAPMessage=soapMessage
End Function
%>