How to Use ASCII Characters in Text, Scripts and HTML

By eHow Internet Editor

Rate: (3 Ratings)

We’re spoiled by word processing programs that easily let us add special characters like the degree symbol, dashes and ampersands into our documents. You may find that when you’re writing a PHP script, a text file or an HTML Web page, those characters don’t display properly. In order to get them to show up right on your Web pages, you need to use special codes to tell the browser which character to display. Here’s how to use ASCII characters in your Web pages and scripts.

Instructions

Difficulty: Moderately Easy

Things You’ll Need:

  • A text program
  • A Web browser
  • A chart of ASCII characters

Use ASCII Characters

Step1
Find a reference chart that gives you the codes to use for your purpose. Many ASCII character charts include the ASCII number codes in hex, dec and HTML numbers as well as HTML names.
Step2
Find the symbol or character that you want to include in your document.
Step3
At the point where you want to display the symbol or character, type the appropriate code.
Step4
Save your file as usual.

Examples

Step1
To display an ampersand in an HTML file, type: &

Step2
To display left angle quotes in your document, type: «
Step3
To display the Registered trademark symbol (R inside a circle), type: ®

Tips & Warnings

  • If you’re using ASCII encoding in an HTML document, be sure to specify the character set in a meta tag in the document head.
  • Remember to end all HTML ASCII substitutions with a semi-colon.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article:  How to Use ASCII Characters in Text, Scripts and HTML

eHow Internet Editor

eHow Internet Editor

Category: Internet

Articles: See my other articles

Related Ads

Internet

Veesites
Meet Virginia DeBolt eHow’s Internet Expert.