Translating chars into character entity codes, Which characters in the standard ASCII set (1-127) should I translate |
Translating chars into character entity codes, Which characters in the standard ASCII set (1-127) should I translate |
Rob Wheeler |
Dec 16 2009, 11:06 AM
Post
#1
|
Group: Members Posts: 1 Joined: 16-December 09 Member No.: 10,601 |
Which characters in the standard ASCII set (1-127) should I translate into character entity codes in my web page?
These are reserved characters which I understand *must* be translated into character entity codes within the coding of a web page. They are used in tags and so the raw characters will mess up your page: quote ... " ampersand ... & less than ... < greater than ... > But I'm not sure about these below. Which ones ought I to translate into entity codes in order to ensure the page renders OK? Or perhaps it doesnt matter. Ive searched all over the place but have not been able to find an authoritative answer. 033 ... ! ... exclamation mark 035 ... # ... hash 036 ... $ ... dollar sign 037 ... % ... percent 038 ... & ... ampersand 042 ... * ... asterisk 047 ... / ... forward slash 059 ... ; ... semi-colon 063 ... ? ... question mark 064 ... @ ... AT symbol 091 ... [ ... left/opening bracket 092 ... \ ... back slash 093 ... ] ... right/closing bracket 094 ... ^ ... caret/circumflex 095 ... _ ... underscore 096 ... ` ... backtick 123 ... { ... left/opening brace 124 ... | ... pipe 125 ... } ... right/closing brace 126 ... ~ ... tilde |
pandy |
Dec 16 2009, 11:53 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I think <, > and & are enough, but don't take my word for it.
|
Darin McGrew |
Dec 16 2009, 12:16 PM
Post
#3
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
As far as HTML is concerned, you should almost always use & for & and you should almost always use < for <
There are times where you can use & and < directly, but given browser quirks and the hassle of remembering the rules, it's easier to use & and < everywhere. " is really needed only inside quoted attributes. > isn't really needed except to protect from browser quirks. But then you also have to consider URL encoding. For example, a space in a URL should be encoded as %20 |
Lo-Fi Version | Time is now: 23rd April 2024 - 08:49 PM |