|
<%
CODEPAGE=51932
Response.ContentType = "text/html"
Response.Charset= "euc-jp"
Response.ExpiresAbsolute=#May 31,2000 23:59:59#
Set Stream = Server.CreateObject( "ADODB.Stream" )
Set CAPIUtil = Server.CreateObject( "CAPICOM.Utilities" )
Set MyData = Server.CreateObject("Scripting.Dictionary")
' **********************************************************
' UTF-8 入力文字列の変換
' **********************************************************
Function ConvertQueryString()
Dim InData,nData,aData,I,strChar
Stream.Open
InData = Split( Request.QueryString, "&" )
For nData = 0 to Ubound( InData )
Stream.Position = 0
Stream.SetEOS
Stream.Charset = "utf-8"
Stream.Type = 1 ' バイナリ
aData = Split( InData(nData), "=" )
strChar =""
For I = 1 to Len( aData(1) )
strChar = Mid( aData(1), I, 1 )
if strChar = "%" then
I = I + 1
strChar = ChrB(CLng( "&H" & Mid( aData(1), I, 2 ) ))
I = I + 1
else
strChar = ChrB(Asc(strChar))
end if
ByteArray = CAPIUtil.BinaryStringToByteArray( strChar )
Stream.Write ByteArray
Next
Stream.Position = 0
Stream.Type = 2 ' テキスト
strChar = Stream.ReadText()
Stream.Position = 0
Stream.SetEOS
Stream.Type = 2 ' テキスト
Stream.Charset = "euc-jp"
Stream.WriteText strChar
Stream.Position = 0
Stream.Charset = "shift_jis"
MyData( aData(0) ) = Stream.ReadText()
Next
Stream.Close
End Function
Call ConvertQueryString()
ujis = ""
' ujis で比較
if MyData("value") = "送信" then
ujis = "送信を受信しました"
end if
Response.Write ujis
%>
| |