Today I've written a routine that should suffice for email. But I'm not entirely sure about it.
Doubt 1: Is it sufficient to encode only
some special characters?
Doubt 2: Did I catch
all relevant special characters?
I wonder what you guys have to say about it. (The advantage over Rick's UrlEncode() is speed.)
FUNCTION EncodeForEMail( tcString )
local lcString
lcString = strtran( tcString, "%", "%25" )
lcString = strtran( lcString, "?", "%3F" )
lcString = strtran( lcString, "&", "%26" )
lcString = strtran( lcString, "=", "%3D" )
lcString = strtran( lcString, chr(13)+chr(10), "%0D%0A" )
lcString = strtran( lcString, chr(13) , "%0D%0A" )
RETURN lcString
>Hi Don,
>
>You're right, it requires encoding of other special charcters also. See URLEncode function in
>
Re: How to escape a string for html in VFP8 Thread #
774646 Message #
774940. It should take care of all special characters encoding.
>
>>Thanks again. I find that it also requires special handling for the "&" character. Are there any others that you know of that won't go through?
Groet,
Peter de Valença
Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.