Function str2asc(strstr)
    str2asc = Hex(asc(strstr))
End Function
Function asc2str(ascasc)
    asc2str = Chr(ascasc)
End Function

Function DeCodeAnsi(s)
	Dim i, sTmp, sResult, sTmp1
	sResult = ""
	For i=1 To Len(s)
		If Mid(s,i,1)="%" Then
			sTmp = "&H" & Mid(s,i+1,2)
			If isNumeric(sTmp) Then
				If CInt(sTmp)=0 Then
					i = i + 2
				ElseIf CInt(sTmp)>0 And CInt(sTmp)<128 Then
					sResult = sResult & Chr(sTmp)
					i = i + 2
				Else
					If Mid(s,i+3,1)="%" Then
						sTmp1 = "&H" & Mid(s,i+4,2)
						If isNumeric(sTmp1) Then
							sResult = sResult & Chr(CInt(sTmp)*16*16 + CInt(sTmp1))
							i = i + 5
						End If
					Else
						sResult = sResult & Chr(sTmp)
						i = i + 2
					End If
				End If
			Else
				sResult = sResult & Mid(s,i,1)
			End If
		Else
			sResult = sResult & Mid(s,i,1)
		End If
	Next
	DeCodeAnsi = sResult
End Function