jdecuyper
jdecuyper

Reputation: 3963

How have Html entities inside asp.net page?

Inside an asp.net page, should I use

<html><title>My page's title from México</title></html>

Or

<html><title>My page&rsquo;s title from M&eacute;xico</title></html>

Both examples have the same output. Since asp.net encodes all my pages to utf-8, there is no need to use html entities, is that right?

Upvotes: 7

Views: 2718

Answers (3)

Nick Berardi
Nick Berardi

Reputation: 54854

The ASCII table is set of characters, arguable the first standardized set of characters back in the days when you could only spare 1 byte per character. http://asciitable.com/ But I did some looking around at the extended character set of ASCII and it appears that the character you are referencing is an ASCII character. So there really isn't a problem which ever way you choose to display your title.

My revised answer is go for less expensive one according to space (i.e. the first one)

Upvotes: 3

TheSmurf
TheSmurf

Reputation: 15568

You're correct; As long as there's unicode at both ends of the pipe, it really doesn't matter. Personally, I would use the first simply because it's more readable.

And, honestly, unicode has been widespread for some time. I personally believe that it's time to leave anyone who can't handle UTF-8 behind.

Upvotes: 3

Nick Berardi
Nick Berardi

Reputation: 54854

The second example will ensure compatibility with ASCII standards of HTML transmition. So my vote is for the second example, so you don't have to ensure the HTML is output and encoded as UTF-8 all the way through all the proxy servers and any other kind of caching and translation that might occur.

Upvotes: 3

Related Questions