Declaring them as &xuml;
etc. didn't work, just writing them as they are leads to display errors.
What to do?
Declaring them as &xuml;
etc. didn't work, just writing them as they are leads to display errors.
What to do?
If your page is encoded as UTF-8, you should be able to use special characters directly (i.e. without converting them into their HTML entity counterparts) without problems. Note that if you declare the encoding in a content-type
meta tag, you should put that tag to the very beginning of the head
section.
You should never have to use HTML entities for those characters, since they have no special meaning in HTML. Just make sure the character encoding of the text you're outputting matches your charset header.
Use an encoding which can encode the characters. I'd recommend UTF-8, which is generally the preferred solution for western languages.
Keep in mind that HTTP headers have precedence over <meta http-equiv=...>
, but you should set both to ensure using the correct encoding when loading the document from non-HTTP sources (eg when saving the file locally).