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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top