Search code examples
htmlxhtmlw3cw3c-validationdtd-parsing

Character entities in XHTML 1.0 metadata?


For my title, keywords and description fields on a page with an XHTML 1.0 Doctype what is the correct usage for non-ascii characters like – é etcetera? Do crawlers and social media sites read them better as:

<title>My webpage — a study in typesetting</title>
<meta name="description" content="A page about character entities in XHTML.  Check my resumé if you don't believe me." />

OR:

<title>My webpage &mdash; a study in typesetting</title>
<meta name="description" content="A page about character entities in XHTML.  Check my resum&#0233; if you don&apos;t believe me." />

Solution

  • You're best to stick to the native characters, but speficy the encoding type. for international charactersets, it's safe to stick with UTF-8: