The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Translating chars into character entity codes, Which characters in the standard ASCII set (1-127) should I translate
Rob Wheeler
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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 &amp; for & and you should almost always use &lt; 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 &amp; and &lt; everywhere.

&quot; is really needed only inside quoted attributes. &gt; 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 08:49 PM