URLEncode and HTMLEncode changed?

  • Thread starter Thread starter me
  • Start date Start date
M

me

Why are characters like ' ! _ % not encoded using the
mentioned methods? ASP.OLD would encode those.

I need to encode strings that I put in a database, and
not get into trouble with chars that have special meaning
in sql. I know I can do string.replace("'","''") but it
would be nice with an encoder that takes care of every char.
 
try this in asp

<%=Server.HTMLEncode("< ' ! _ % >")%>

you will get html only for the brackets <>

Alexey
 
Back
Top