보내는쪽의 소스입니다.
get으로 보낼때는 한글도 안깨지고 잘되었습니다.
그런데 post로 변경하고
x.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 이거
추가하니깐
한글이 깨집니다.
전송하는 데이터가 textarea라 용량이 많은데. get으로는 안되서여 반드시 post 로
해야되는디.
한글이....
---- send.asp ------
<SCRIPT
LANGUAGE="JavaScript">
<!--
function
viewCal()
{
fn_Contents =
document.Frm_Contents.txt_Contents.value ;
x.setRequestHeader("Accept-Language",
"ko");
x.setRequestHeader("Accept-Encoding", "gzip,
deflate");
x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
x.send("Contents="+fn_Contents+"");
var strv =
x.responseBody;
document.all.d.innerHTML =
BinDecode(strv);
}
//-->
</SCRIPT>
<script
language="vbscript">
'-----------------------------------------
'
BinDecode (바이너리 -> 아스키 변환)
' mongmong - 2003.
2
'-----------------------------------------
Public Function
BinDecode(byVal binData)
Dim i, byteChr, strV
For
i = 1 to LenB(binData)
byteChr =
AscB(MidB(binData,i,2))
If byteChr > 127
Then
i = i + 1
strV = strV
& Chr("&H" & Hex(byteChr) &
Hex(AscB(MidB(binData,i,2))))
Else
strV
= strV & Chr(byteChr)
End
if
Next
BinDecode = strV
End Function
</script>
<table width="90%" height="100%"
border="0" cellspacing="0" cellpadding="0" >
<Form
method="post" name="Frm_Contents">
<tr
>
<td ><textarea
name="txt_Contents" style="width:100%; height:100%; overflow:auto; border:0px;
></textarea></td>
</tr>
</Form>
</table>
--- process.asp ----
<%
Contents =
Request("Contents")
--> 디비에 인서트합니다. 다음에 다시 셀랙트해서 아래와 같이 뿌려줍니다.
Response.Write Contents
%>