Function HtmlDecode(strText) 'As String
Dim strBuffer, lngPosition
For lngPosition = 1 To Len(strText)
If Mid(strText, lngPosition, 1) = "#" Then
strBuffer = strBuffer & Chr("&H" & Mid(strText, lngPosition + 1, 2))
lngPosition = lngPosition + 2
Else
strBuffer = strBuffer & Mid(strText, lngPosition, 1)
End If
Next
HtmlDecode = strBuffer
End Function
Function HtmlEncode(strText)
'Because it is NEVER safe to display data that has been influenced by a user.
Dim strBuffer, lngPos
strBuffer = ""
If Not IsNull(strText) Then
If strText <> "" Then
For lngPos = 1 To Len(strText)
strBuffer = strBuffer & "" & Asc(Mid(strText, lngPos, 1)) & ";"
Next
End If
HtmlEncode = strBuffer
End Function