Accents and HtmlEncode

C

Chris Leffer

Hi.

I am having problems to use HtmlEncode with strings that use accents. My
page uses some expressions like that:

<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Name").Trim)
%>

If the 'Name' has no accents all works well. But if the 'Name ' has
accents they appear encoded, like N&#227.

How can I solve this? I need to correctly display the accented
characters, but wants to use HtmlEncode to help me prevent problems with
malicious/erroneous data.

Regards,
Chris Leffer
 

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

Members online

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top