HTML and ASCII Character table

Here is our list of ASCII characters and numbered and HTML entity codes. We use this to build a cold fusion function. It makes it heck lot easier to manage and figure out what character is missing then a two long list of bad characters and good characters.

There are five columns below first column contains the ASCII codes. The second column contains the number refrenced and the third column contains the HTML entity reference. Where there is no HTML entity for a code it display "null". 4th and 5th columns are the display using Numer and HTML entity.

For the cold fusion function it uses HTML entities and number entity.

If you like to grab my comma delimited source list click here. If we're missing some then email me so I can update this list umer – @ – octadyne.com.

ASCII Number Entity Number Display Entity Display
128 € €
130 ‚ ‚
131 ƒ ƒ ƒ ƒ
132 „ „
133 … …
134 † †
135 ‡ ‡
136 ˆ ˆ ˆ ˆ
137 ‰ ‰
138 Š Š Š Š
139 ‹ ‹
140 Œ Œ Œ Œ
142 Ž null Ž null
145 ‘ ‘
146 ’ ’
147 “ “
148 ” ”
149 • •
150 – –
151 — —
152 ˜ ˜ ˜ ˜
153 ™ ™
154 š š š š
155 › ›
156 œ œ œ œ
158 ž null ž null
159 Ÿ null Ÿ null
161 ¡ ¡ ¡ ¡
162 ¢ ¢ ¢ ¢
163 £ £ £ £
164 ¤ ¤ ¤ ¤
165 ¥ ¥ ¥ ¥
166 ¦ ¦ ¦ ¦
167 § § § §
168 ¨ ¨ ¨ ¨
169 © © © ©
170 ª ª ª ª
171 « « « «
172 ¬ ¬ ¬ ¬
173 ­ ­ ­ ­
174 ® ® ® ®
175 ¯ ¯ ¯ ¯
176 ° ° ° °
177 ± ± ± ±
178 ² ² ² ²
179 ³ ³ ³ ³
180 ´ ´ ´ ´
181 µ µ µ µ
182 ¶ ¶
183 · · · ·
184 ¸ ¸ ¸ ¸
185 ¹ ¹ ¹ ¹
186 º º º º
187 » » » »
188 ¼ ¼ ¼ ¼
189 ½ ½ ½ ½
190 ¾ ¾ ¾ ¾
191 ¿ ¿ ¿ ¿
192 À À À À
193 Á Á Á Á
194 Â Â Â Â
195 Ã Ã Ã Ã
196 Ä Ä Ä Ä
197 Å Å Å Å
198 Æ Æ Æ Æ
199 Ç Ç Ç Ç
200 È È È È
201 É É É É
202 Ê Ê Ê Ê
203 Ë Ë Ë Ë
204 Ì Ì Ì Ì
205 Í Í Í Í
206 Î Î Î Î
207 Ï Ï Ï Ï
208 Ð Ð Ð Ð
209 Ñ Ñ Ñ Ñ
210 Ò Ò Ò Ò
211 Ó Ó Ó Ó
212 Ô Ô Ô Ô
213 Õ Õ Õ Õ
214 Ö Ö Ö Ö
215 × × × ×
216 Ø Ø Ø Ø
217 Ù Ù Ù Ù
218 Ú Ú Ú Ú
219 Û Û Û Û
220 Ü Ü Ü Ü
221 Ý Ý Ý Ý
222 Þ Þ Þ Þ
223 ß ß ß ß
224 à à à à
225 á á á á
226 â â â â
227 ã ã ã ã
228 ä ä ä ä
229 å å å å
230 æ æ æ æ
231 ç ç ç ç
232 è è è è
233 é é é é
234 ê ê ê ê
235 ë ë ë ë
236 ì ì ì ì
237 í í í í
238 î î î î
239 ï ï ï ï
240 ð ð ð ð
241 ñ ñ ñ ñ
242 ò ò ò ò
243 ó ó ó ó
244 ô ô ô ô
245 õ õ õ õ
246 ö ö ö ö
247 ÷ ÷ ÷ ÷
248 ø ø ø ø
249 ù ù ù ù
250 ú ú ú ú
251 û û û û
252 ü ü ü ü
253 ý ý ý ý
254 þ þ þ þ
255 ÿ ÿ ÿ ÿ

ColdFusion Function

This is same as HTMLSafe function on CFLib.org. Only thing I did is ordered it and wrote a script to auto generate this from my list. Beats the heck out of hand editing the goodchar and badchar list.
<cfscript>
/**
 * Coverts special characters to character entities, making a string safe for display in HTML.
 * 
 * @param string 	 String to format. (Required)
 * @return Returns a string. 
 * @author Gyrus (gyrus@norlonto.net) 
 * @version 1, April 30, 2003 
 */
function HTMLSafe(string)
{
	var badChars="#chr(128)#,#chr(130)#,#chr(131)#,#chr(132)#,#chr(133)#,#chr(134)#,#chr(135)#,#chr(136)#,#chr(137)#,#chr(138)#,#chr(139)#,#chr(140)#,#chr(142)#,#chr(145)#,#chr(146)#,#chr(147)#,#chr(148)#,#chr(149)#,#chr(150)#,#chr(151)#,#chr(152)#,#chr(153)#,#chr(154)#,#chr(155)#,#chr(156)#,#chr(158)#,#chr(159)#,#chr(161)#,#chr(162)#,#chr(163)#,#chr(164)#,#chr(165)#,#chr(166)#,#chr(167)#,#chr(168)#,#chr(169)#,#chr(170)#,#chr(171)#,#chr(172)#,#chr(173)#,#chr(174)#,#chr(175)#,#chr(176)#,#chr(177)#,#chr(178)#,#chr(179)#,#chr(180)#,#chr(181)#,#chr(182)#,#chr(183)#,#chr(184)#,#chr(185)#,#chr(186)#,#chr(187)#,#chr(188)#,#chr(189)#,#chr(190)#,#chr(191)#,#chr(192)#,#chr(193)#,#chr(194)#,#chr(195)#,#chr(196)#,#chr(197)#,#chr(198)#,#chr(199)#,#chr(200)#,#chr(201)#,#chr(202)#,#chr(203)#,#chr(204)#,#chr(205)#,#chr(206)#,#chr(207)#,#chr(208)#,#chr(209)#,#chr(210)#,#chr(211)#,#chr(212)#,#chr(213)#,#chr(214)#,#chr(215)#,#chr(216)#,#chr(217)#,#chr(218)#,#chr(219)#,#chr(220)#,#chr(221)#,#chr(222)#,#chr(223)#,#chr(224)#,#chr(225)#,#chr(226)#,#chr(227)#,#chr(228)#,#chr(229)#,#chr(230)#,#chr(231)#,#chr(232)#,#chr(233)#,#chr(234)#,#chr(235)#,#chr(236)#,#chr(237)#,#chr(238)#,#chr(239)#,#chr(240)#,#chr(241)#,#chr(242)#,#chr(243)#,#chr(244)#,#chr(245)#,#chr(246)#,#chr(247)#,#chr(248)#,#chr(249)#,#chr(250)#,#chr(251)#,#chr(252)#,#chr(253)#,#chr(254)#,#chr(255)#";
	var goodChars="&euro;,&sbquo;,&fnof;,&bdquo;,&hellip;,&dagger;,&Dagger;,&circ;,&permil;,&Scaron;,&lsaquo;,&OElig;,&##381;,&lsquo;,&rsquo;,&ldquo;,&rdquo;,&bull;,&ndash;,&mdash;,&tilde;,&trade;,&scaron;,&rsaquo;,&oelig;,&##382;,&##376;,&iexcl;,&cent;,&pound;,&curren;,&yen;,&brvbar;,&sect;,&uml;,&copy;,&ordf;,&laquo;,&not;,&shy;,&reg;,&macr;,&deg;,&plusmn;,&sup2;,&sup3;,&acute;,&micro;,&para;,&middot;,&cedil;,&sup1;,&ordm;,&raquo;,&frac14;,&frac12;,&frac34;,&iquest;,&Agrave;,&Aacute;,&Acirc;,&Atilde;,&Auml;,&Aring;,&AElig;,&Ccedil;,&Egrave;,&Eacute;,&Ecirc;,&Euml;,&Igrave;,&Iacute;,&Icirc;,&Iuml;,&ETH;,&Ntilde;,&Ograve;,&Oacute;,&Ocirc;,&Otilde;,&Ouml;,&times;,&Oslash;,&Ugrave;,&Uacute;,&Ucirc;,&Uuml;,&Yacute;,&THORN;,&szlig;,&agrave;,&aacute;,&acirc;,&atilde;,&auml;,&aring;,&aelig;,&ccedil;,&egrave;,&eacute;,&ecirc;,&euml;,&igrave;,&iacute;,&icirc;,&iuml;,&eth;,&ntilde;,&ograve;,&oacute;,&ocirc;,&otilde;,&ouml;,&divide;,&oslash;,&ugrave;,&uacute;,&ucirc;,&uuml;,&yacute;,&thorn;,&yuml;";
	
	// if you like to go number route then comment the above goodChars and uncomment the following
	//var goodChars="&##8364;,&##8218;,&##402;,&##8222;,&##8230;,&##8224;,&##8225;,&##710;,&##8240;,&##352;,&##8249;,&##338;,&##381;,&##8216;,&##8217;,&##8220;,&##8221;,&##8226;,&##8211;,&##8212;,&##732;,&##8482;,&##353;,&##8250;,&##339;,&##382;,&##376;,&##161;,&##162;,&##163;,&##164;,&##165;,&##166;,&##167;,&##168;,&##169;,&##170;,&##171;,&##172;,&##173;,&##174;,&##175;,&##176;,&##177;,&##178;,&##179;,&##180;,&##181;,&##182;,&##183;,&##184;,&##185;,&##186;,&##187;,&##188;,&##189;,&##190;,&##191;,&##192;,&##193;,&##194;,&##195;,&##196;,&##197;,&##198;,&##199;,&##200;,&##201;,&##202;,&##203;,&##204;,&##205;,&##206;,&##207;,&##208;,&##209;,&##210;,&##211;,&##212;,&##213;,&##214;,&##215;,&##216;,&##217;,&##218;,&##219;,&##220;,&##221;,&##222;,&##223;,&##224;,&##225;,&##226;,&##227;,&##228;,&##229;,&##230;,&##231;,&##232;,&##233;,&##234;,&##235;,&##236;,&##237;,&##238;,&##239;,&##240;,&##241;,&##242;,&##243;,&##244;,&##245;,&##246;,&##247;,&##248;,&##249;,&##250;,&##251;,&##252;,&##253;,&##254;,&##255;";
	
	
	// Return immediately if blank string
	if (NOT Len(Trim(string))) return string;
	
	// Do replacing
	return ReplaceList(string, badChars, goodChars);
}
</cfscript>

CFDocument Test