Very fast function to encode or decode Quoted-Printable.
VB6 only, but you can make it work with other versions, with a 3rd party replace function.
Public Function DecodeQP(ByRef StrToDecode As String) As String
Dim sTemp As String
Dim i As Integer
sTemp = StrToDecode
For i = 255 To 127 Step -1
If InStr(1, sTemp, "=" & Hex$(i)) <> 0 Then sTemp = Replace(sTemp, "=" & Hex$(i), Chr$(i))
Next
If InStr(1, sTemp, "=" & Hex$(61)) <> 0 Then sTemp = Replace(sTemp, "=" & Hex$(61), Chr$(255) & Chr$(254))
For i = 32 To 10 Step -1
If InStr(1, sTemp, "=" & Hex$(i)) <> 0 Then sTemp = Replace(sTemp, "=" & Hex$(i), Chr$(i))
Next
For i = 9 To 0 Step -1
If InStr(1, sTemp, "=" & "0" & Hex$(i)) <> 0 Then sTemp = Replace(sTemp, "=" & Hex$(i), Chr$(i))
Next
sTemp = Replace(sTemp, "=", "")
sTemp = Replace(sTemp, Chr$(255) & Chr$(254), "=")
DecodeQP = sTemp
End Function
Public Function EncodeQP(ByRef StrToEncode As String) As String
Dim sTemp As String
Dim i As Integer
sTemp = StrToEncode
For i = 255 To 127 Step -1
If InStr(1, sTemp, Chr$(i)) <> 0 Then sTemp = Replace(sTemp, Chr$(i), "=" & Hex$(i))
Next
If InStr(1, sTemp, Chr$(61)) <> 0 Then sTemp = Replace(sTemp, Chr$(61), "=" & Hex$(61))
For i = 32 To 10 Step -1
If InStr(1, sTemp, Chr$(i)) <> 0 Then sTemp = Replace(sTemp, Chr$(i), "=" & Hex$(i))
Next
For i = 9 To 0 Step -1
If InStr(1, sTemp, Chr$(i)) <> 0 Then sTemp = Replace(sTemp, Chr$(i), "=" & "0" & Hex$(i))
Next
EncodeQP = sTemp
End Function