Incorrect handling of HTML entities


Entities like LT and GT are encoded correctly, but entities like ENDASH, EMDASH, SIGMA, BULL and others get replaced by their unicode counterparts instead of being kept as they are.
Closed Apr 20, 2011 at 3:10 PM by bdorrans
Fixed in 4.0


bdorrans wrote Feb 24, 2010 at 3:40 AM

Which methods produce this behave? If I can get some more information then I can start to track it down.


martinording wrote May 17, 2010 at 9:29 AM

AFAIK, HTML entities like the ones you describe are pretty much obsolete nowadays, since all browsers support unicode.
If this is "fixed", please make it an option. I would prefer real characters in my database and not html entities, where possible.

bdorrans wrote May 17, 2010 at 3:09 PM

This has been addressed by a new overload to HtmlEncode where you can specify a boolean to use named entities. The default will be to not use them, as that's the existing behaviour.

However in order to match the .NET framework behaviour you will see <, >, & and " as their named entities in both HTML and XML encoding.

wrote Apr 20, 2011 at 3:10 PM

wrote Feb 22, 2013 at 1:07 AM

wrote May 16, 2013 at 12:29 PM