Have you ever wondered how to post code snippets on your site to demonstrate an example? I have to admit myself that I’ve tried myself to use <pre> or <code> tags, hoping that it would solve my frustration. After few trial and errors, some research, I found out that that you need to encode the html entities, like the ‚Äú<‚Äù by replacing them with their html code equivalents.
HTML Code | Browser View | HTML Code | Browser View | HTML Code | Browser View | HTML Code | Browser View | HTML Code | Browser View |
---|---|---|---|---|---|---|---|---|---|
© | ¬© | ! | ! | _ | _ |  | ? | Û | √õ |
® | ¬Æ | " | “ | ` | ` | ž | ≈æ | Ü | √ú |
| # | # | a | a | Ÿ | ≈∏ | Ý | √ù | |
" | “ | $ | $ | b | b |   | Þ | √û | |
& | & | % | % | c | c | ¡ | ¬° | ß | √ü |
< | < | & | & | d | d | ¢ | ¬¢ | à | √† |
> | > | ' | ‘ | e | e | £ | ¬£ | á | √° |
À | √Ä | ( | ( | f | f | ¤ | ¬§ | â | √¢ |
Á | √Å | ) | ) | g | g | ¥ | ¬• | ã | √£ |
 | √Ç | * | * | h | h | ¦ | ¬¶ | ä | √§ |
à | √É | + | + | i | i | § | ¬ß | å | √• |
Ä | √Ñ | , | , | j | j | ¨ | ¬® | æ | √¶ |
Å | √Ö | - | – | k | k | © | ¬© | ç | √ß |
Æ | √Ü | . | . | l | l | ª | ¬™ | è | √® |
Ç | √á | / | / | m | m | « | ¬´ | é | √© |
È | √à | 0 | 0 | n | n | ¬ | ¬¨ | ê | √™ |
É | √â | 1 | 1 | o | o | ­ | ¬≠ | ë | √´ |
Ê | √ä | 2 | 2 | p | p | ® | ¬Æ | ì | √¨ |
Ë | √ã | 3 | 3 | q | q | ¯ | ¬Ø | í | √≠ |
Ì | √å | 4 | 4 | r | r | ° | ¬∞ | î | √Æ |
Í | √ç | 5 | 5 | s | s | ± | ¬± | ï | √Ø |
Î | √é | 6 | 6 | t | t | ² | ¬≤ | ð | √∞ |
Ï | √è | 7 | 7 | u | u | ³ | ¬≥ | ñ | √± |
Ð | √ê | 8 | 8 | v | v | ´ | ¬¥ | ò | √≤ |
Ñ | √ë | 9 | 9 | w | w | µ | ¬µ | ó | √≥ |
Õ | √ï | : | : | x | x | ¶ | ¬∂ | ô | √¥ |
Ö | √ñ | ; | ; | y | y | · | ¬∑ | õ | √µ |
Ø | √ò | < | < | z | z | ¸ | ¬∏ | ö | √∂ |
Ù | √ô | = | = | { | { | ¹ | ¬π | ÷ | √∑ |
Ú | √ö | > | > | | | | | º | ¬∫ | ø | √∏ |
Û | √õ | ? | ? | } | } | » | ¬ª | ù | √π |
Ü | √ú | @ | @ | ~ | ~ | ¼ | ¬º | ú | √∫ |
Ý | √ù | A | A |  | ? | ½ | ¬Ω | û | √ª |
Þ | √û | B | B | € | ‚Ǩ | ¾ | ¬æ | ü | √º |
ß | √ü | C | C |  | ? | ¿ | ¬ø | ý | √Ω |
à | √† | D | D | ‚ | ‚Äö | À | √Ä | þ | √æ |
á | √° | E | E | ƒ | ∆í | Á | √Å | ÿ | √ø |
å | √• | F | F | „ | ‚Äû |  | √Ç | ||
æ | √¶ | G | G | … | ‚Ķ | à | √É | ||
ç | √ß | H | H | † | ‚Ć | Ä | √Ñ | ||
è | √® | I | I | ‡ | ‚Ä° | Å | √Ö | ||
é | √© | J | J | ˆ | ÀÜ | Æ | √Ü | ||
ê | √™ | K | K | ‰ | ‚Ä∞ | Ç | √á | ||
ë | √´ | L | L | Š | ≈† | È | √à | ||
ì | √¨ | M | M | ‹ | ‚Äπ | É | √â | ||
í | √≠ | N | N | Œ | ≈í | Ê | ? | ||
î | √Æ | O | O |  | ? | Ë | √ã | ||
ï | √Ø | P | P | Ž | ≈Ω | Ì | √å | ||
ð | √∞ | Q | Q |  | ? | Í | √ç | ||
ñ | √± | R | R |  | ? | Î | √é | ||
ò | √≤ | S | S | ‘ | ‚Äò | Ï | √è | ||
ó | √≥ | T | T | ’ | ‚Äô | Ð | √ê | ||
ô | √¥ | U | U | “ | ‚Äú | Ñ | √ë | ||
õ | √µ | V | V | ” | ‚Äù | Ò | √í | ||
ö | √∂ | W | W | • | ‚Ä¢ | Ó | √ì | ||
ø | √∏ | X | X | – | ‚Äì | Ô | √î | ||
ù | √π | Y | Y | — | ‚Äî | Õ | √ï | ||
ú | √∫ | Z | Z | ˜ | Àú | Ö | √ñ | ||
û | √ª | [ | [ | ™ | ‚Ñ¢ | × | √ó | ||
ý | √Ω | \ | \ | š | ≈° | Ø | √ò | ||
þ | √æ | ] | ] | › | ‚Ä∫ | Ù | √ô | ||
ÿ | √ø | ^ | ^ | œ | ≈ì | Ú | √ö |
If you feel a little overwhelmed by trying type up all those characters when you find yourself in need of using it, you might enjoy a Encode/Decode HTML entities tool at centricle.com. You can paste in your code snippet and convert it into ACII characters just by one click. Enjoy! 🙂