asp---CreateObject("adodb.stream") 파일은utf-8 형식으로 쓰기

546 단어 ASP
CreateObject ("Scripting.FileSystemObject") 로 utf-8 파일을 쓰면 인코딩 문제가 발생합니다.
"CreateObject ("adodb.stream ") 를 사용하여 쓸 수 있으며, 인코딩을utf-8로 설정하면 됩니다.
function writeToFile(charset,content,filepath)

			set stm=server.CreateObject("adodb.stream")
			stm.Type=2'      
			stm.mode=3
			stm.charset=charset
			stm.open
			stm.WriteText content
			stm.SaveToFile server.MapPath(filepath),2 
			stm.flush
			stm.Close
			set stm=nothing
		end function

charset:인코딩
콘텐츠: 쓰기
filepath:파일 경로

좋은 웹페이지 즐겨찾기