all groups > inetserver asp components > october 2005 >
You're in the

inetserver asp components

group:

ASPHTTP Multilingual Support


ASPHTTP Multilingual Support jenschindler NO[at]SPAM gmail.com
10/27/2005 5:53:08 AM
inetserver asp components:
Hello,

I was wondering if anyone would happen to know how I can get ASPHTTP to
post data in the UTF-8 character set?

I have sent an email to technical support at Server Objects, but
haven't received a response from them about this.

Any help you can provide would be greatly appreciated!

Thanks!
Re: ASPHTTP Multilingual Support Egbert Nierop (MVP for IIS)
10/30/2005 8:33:01 PM

[quoted text, click to view]

They are more or less, inactive, as you can see, the copyright date, has
gone up to 2003 but no further.
The same might be to support.

The ServerXMLHTTP object, can do the same for you and you can specify
charsets.
(vbscript syntax)

Set pXMLHTTPReq = CreateObject("MSXML2.ServerXMLHTTP.4.0")
pXMLHTTPReq.setRequestHeader "charset", "UTF-8"
pXMLHTTPReq.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
pXMLHTTPReq.send [yourbodyUNICODE2string]

[quoted text, click to view]
Re: ASPHTTP Multilingual Support jenschindler NO[at]SPAM gmail.com
11/1/2005 6:42:34 AM
Thanks for your reply!

I tried ServerXMLHTTP (using your example code), but the form doesn't
post.

Here is my code:

set HTTPObj = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
HTTPObj.Open "POST", "myURL", False
HTTPObj.setRequestHeader "charset", "UTF-8"
HTTPObj.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
HTTPObj.Send strQuery
set HTTPObj = nothing

Got any ideas?

TIA!
Re: ASPHTTP Multilingual Support Egbert Nierop (MVP for IIS)
11/2/2005 11:02:31 AM

[quoted text, click to view]


ps: To -read- this post well, your NNTP reader, needs to support UTF-8 if it
does not, it might be a *unix or linux ASCII reader, which sucks :)

[quoted text, click to view]

It really works...
name your page 'fetch.asp'

'code page=utf-8
' safe these pages as utf-8 in notepad for instance!

<% @codepage=65001 %>
<%
Dim log, myfile

Set Log = CreateObject("Scripting.FileSystemObject")
Set myfile = log.OpenTextFile("c:\\temp\\somelog.txt", 8, True,-1)
myfile.WriteLine(Request.Form("var1"))
myfile.WriteLine(Request.QueryString("page"))
myfile.Close
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>test</title></head>
<body>
<p>Success</p>
</body>
</html>


name this as postit.asp (ps: Server.CreateObject is legacy stuff with some
overhead, just use CreateObject)
<% @codepage=65001 %>

<%

set HTTPObj = CreateObject("Msxml2.ServerXMLHTTP.4.0")

HTTPObj.Open "POST", "http://localhost/fetch.asp?page=welcome", False

HTTPObj.setRequestHeader "charset", "UTF-8"

HTTPObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

HTTPObj.Send "var1=" + Server.UrlEncode("345+_23498234LDSF@@#1!@#$%^&()Экак
дела?")

%>


Result
c:\temp\somelog.txt is unicode, completely and reads exactly the value as
posted in var1...


[quoted text, click to view]

Be my guest...

--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm
AddThis Social Bookmark Button