쓸만한 주저리

asp에서 ajax방식으로 정보를 가져올 때 한글 문제 해결법

봄돌73 2006. 4. 7. 11:28

<%
  set xml = server.CreateObject("MSXML2.XMLHTTP")

  xml.open "POST","" & "http://news.naver.com/" & "",false
  xml.send ""

  strStatus = xml.Status
  str = xml.responseText
  response.binaryWrite xml.responsebody

  Response.CharSet = "euc-kr"
  set xml = nothing

%>

 

내용을 이진 문자열로 받으면 한글이 깨지지 않는다.

그래도 혹시 깨질까봐 문자 형식까지 지정했다.