eHow launches Android app: Get the best of eHow on the go.

How To

How to Use ASCII Characters in Text, Scripts and HTML

Contributor
By eHow Contributing Writer
(6 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.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

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

    Use ASCII Characters

  1. Step 1

    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.

  2. Step 2

    Find the symbol or character that you want to include in your document.

  3. Step 3

    At the point where you want to display the symbol or character, type the appropriate code.

  4. Step 4

    Save your file as usual.

  5. Examples

  6. Step 1

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

  7. Step 2

    To display left angle quotes in your document, type: «

  8. Step 3

    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.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.

Demand Media
eHow_eHow Technology and Electronics