asp base64 utf-8은 asp.net의 base64 제조업체에서 다운로드합니다:
<%@LANGUAGE=VBSCRIPT 코드페이지=65001%>
<%Session.CodePage=65001%>
<!--#포함 파일=base64.asp-->
<%
함수 AspUrlDecode(strValue)
Dim varAry, varElement, objStream, lngLoop, 플래그
strValue = 바꾸기(strValue, +, )
varAry = 분할(strValue, %)
플래그 = varAry(0) =
objStream = Server.CreateObject(ADODB.Stream) 설정
objStream 사용
.유형 = 2
.모드 = 3
.열려 있는
varAry의 각 varElement에 대해
varElement <> 비어 있는 경우 그러면
Len(varElement) >= 2이고 플래그를 지정하면
.WriteText ChrB(CInt(&H & 왼쪽(varElement, 2)))
lngLoop = 3의 경우 Len(varElement)
.WriteText ChrB(Asc(Mid(varElement, lngLoop, 1)))
다음
또 다른
lngLoop = 1의 경우 Len(varElement)
.WriteText ChrB(Asc(Mid(varElement, lngLoop, 1)))
다음
플래그 = 참
종료 조건
종료 조건
다음
.WriteText 문자(0)
.위치 = 0
AspUrlDecode = 바꾸기(ConvUnicode(.ReadText), Chr(0), , 1, -1, 0)
오류 발생 시 다음 재개
.닫다
objStream = 없음으로 설정
끝
기능 종료
함수 ConvUnicode(ByVal strData)
Dim rs, stm, bytAry, intLen
Len(strData & ) > 0이면
strData = MidB(strData, 1)
intLen = LenB(strData)
rs = Server.CreateObject(ADODB.Recordset) 설정
stm = Server.CreateObject(ADODB.Stream) 설정
RS와 함께
.Fields.Append X, 205, intLen
.열려 있는
.새로 추가
rs(0).AppendChunk strData 및 ChrB(0)
.업데이트
bytAry = rs(0).GetChunk(intLen)
끝
stm으로
.유형 = 1
.열려 있는
.Write bytAry
.위치 = 0
.유형 = 2
.Charset = utf-8
ConvUnicode = .ReadText
끝
종료 조건
오류 발생 시 다음 재개
stm.닫기
stm = 없음으로 설정
RS.닫기
rs = 없음으로 설정
기능 종료
%>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html xmlns=http://www.w3.org/1999/xhtml>
<머리>
<meta http-equiv=Content-Type content=text/html; 문자셋=utf-8 />
</head>
<본문>
<%
'base64编码后,比起.net多了77u/
Response.Write(base64编码后:&base64Encode(阿会楠)&<br />)
'base64解码后
Response.Write(base64解码后:&base64uncode(6Zi/5Lya5qWg)&<br />)
%>
</body>
</html>