Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dealing with Funky Characters é

Status
Not open for further replies.

ironhide1975

Programmer
Feb 25, 2003
451
US
How do you get characters that go into the database as one character come back correctly. For example, if I have someone type in a textbox

Code:
é

And it comes back as the character e with the notation on top of it. Is there anyway to have it reappear in the text box after a save as the way it was entered? Probably a replace command? Any help is appreciated.

 
Hi Ironhide,

When you display the text back to the user you should be using the inbuilt Server.HtmlEncode() function, e.g.:

Code:
s_UserString = "é"

Response.Write( Server.HtmlEncode( s_UserString ) )

All user input should be encoded in this way when written back to reduce the possibility of cross site scripting attacks, otherwise they could supply a string such as <script>alert('hello')</script> to affect other users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top