I am still not able to get this to work. Here is the function that I wrote to simulate the escape() function. There is a page on the Netscape site that I am testing it against- developer.netscape.com/viewsource/husted_mailto/mailto.html
They encode "<$"%123" into %22%3C%24%22%25123%22. I have written URLencode below to simulate this. I can't even compile when I set pszString="<$/"%123" because I get a missing " error on the last quote. BTW, they set spaces to equal %20, not +.
char szEncoded[200];
void URLEncode(char *pszString)
{
char szChar[3];
int iChar;
memset(szEncoded,0,sizeof(szEncoded));
j=0;
for (i=0;i {
// don't touch alphanumeric chars
if (((pszString[i]>=48)&&(pszString[i]<=57))||
((pszString[i]>=65
)&&(pszString[i]<=90))||
((pszString[i]>=97)&&(pszString[i]<=122)))
{
szEncoded[j]=pszString[i];
j++;
continue;
}
if (pszString[i]==32) //' replace space with "+"
{
szEncoded[j]='+';
j++;
continue;
}
//Else
// ' replace punctuation chars with "%hex"
szEncoded[j]='%';
j++;
iChar=pszString[i];
sprintf(szChar,"%x",iChar);
strncat(szEncoded,szChar,2);
j=j+2;
}
}