I'm using a web service for passing information from a bunch of old .asp pages to a database. Problem is that using httpGet, I need to encode the info so it can be safely passed.
Everything works like a dream, save for the fact that scandinavian letters such as ä ö and å for example come out as squares. Now I don't even know whether this has to do with the company IIS language settings (can't touch them) or something, but I'm wondering if there's a way to force the asp-page to use a specific encoding, and then force the asp.net web service to decode with the same character-set, without any kind of server settings inbetween getting the chance to mix it all up?
I tried to look around, but didn't find any clear-cut examples of exactly how you can do this. Please keep the replies simple, I'm just a beginner on internship here. Thanks for the help!
Edit: Apologies. Didn't include the code because it was so simple I didn't think it'd reveal anything anyway. Here:
.asp
function loginfo()
Dim text
text = "ääböö"
text = Server.URLENCODE(text)
message = "http://server1/logger_webservice/service.asmx/test_Event?" & _
"userID=" & userID
Set objRequest = Server.createobject("MSXML2.XMLHTTP")
With objRequest
.open "GET", message, False
.setRequestHeader "Content-Type", "text/xml"
.send
End With
loginfo = objRequest.responseText
end function
web server:
<WebMethod()> _
Public Function test_Event(ByVal userId As String) As Boolean
Dim kirj As StreamWriter
kirj = File.CreateText("C:\Inetpub\server1\Logger_WebService\test_logEvent.txt")
userId = Server.UrlDecode(userId)
kirj.WriteLine("userId = " & userId)
kirj.Close()
kirj.Dispose()
End Function
Anyway, thanks for help. I'll be looking into this more but as usual, stress and rush is forcing me to move on. I wrote a simple code to encrypt the most used scandinavian letters manually, and decrypted them in the web server. Works fine so far, I just hope there aren't any complications alter on. Just wanted the basic Finnish letters ä, ö and å anyway. :)
I just thought there was some easy method to force the encoding to a specific charset that I just couldn't find. Tend to be terrible at finding information on my own.