What is the right way to present special characters like éè and tabs in XHTML?
- ØØ -
Printable View
What is the right way to present special characters like éè and tabs in XHTML?
- ØØ -
I suppose you could say it depends on the page char set and stuff but the normal HTML entities are normally best too use :)Quote:
Originally Posted by NoteMe
http://www.howtocreate.co.uk/sidehtmlentity.html is a good place to start - if your pageis outputted from PHP you can always use the htmlentities() function to do the work for you :)
Cheers,
Ryan Jones
Tricky question.
Tabs are best presented as literal tabs, but you need preformatted text (<pre> or whitespace: pre) to make them actually show up.
Special characters ... the XHTML DTD defines the entire set of character entities that HTML has. The problem here lies in the fact that XHTML is an XML language. Pure XML processors might be expected to parse and understand it, not only browsers. Browsers will have those entities built in. Validating XML parsers have to read the XML and thus get all the entities, so they're fine, too. But there are non-validating XML parsers out there, and those don't read DTDs, thus they don't get the entities, thus they can't read things like é.
The only way to satisfy all parsers is thus to use numerical references, i.e. &#abcd;, where abcd is the Unicode code point of the character you want.
Thanks sciguyryan, now that was a nice web page. It is now del.icio.us'ed. I will go with your final words CornedBee, and use sciguyryan page as a reference, since this is mainly a static web page.
PS: Woohooo...I can even write my name on a web page now, and get it right in all browsers..:)
- ØØ -