How to Use ASCII Characters in Text, Scripts and HTML

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.

Things You'll Need

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

Instructions

  1. Use ASCII Characters

    • 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

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

    • 3

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

    • 4

      Save your file as usual.

    Examples

    • 5

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

    • 6

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

    • 7

      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.

Related Searches:

Comments

You May Also Like

  • How to Use Excel's Code Function

    Excel's Code function determines the numeric representation for the first character in the specified text string. This value is determined by the...

  • How to Use Tracfone Bonus Codes

    Tracfone is a prepaid cell phone that enables you to buy minutes to talk to friends and family. Unlike other cell phone...

  • How to Type Ascii Characters in WoW

    World of Warcraft, or WoW as it is known to millions of players, is the incredibly popular MMPORPG (massively multiplayer online roleplaying...

  • How to Make ASCII Art

    Use graph paper for more precision. Use a black and white printout or photocopy of the desired image. An image for ASCII...

  • ASCII to ANSI Conversion

    ASCII stands for the American Standard Code for Information Interchange. It was created with the intention of establishing a universal index of...

  • How to Create ASCII Art

    ASCII is plain text without any embedded coding. Using ASCII characters to render art has long been considered a "geek" pursuit, but...

  • How to Use HTML Symbols

    HTML symbols are used when you need to insert new characters that are not part of the standard ASCII specification. For example,...

  • Difference Between ANSI & ASCII

    ANSI and ASCII are commonly encountered acronyms that have a shared heritage. One represents a standards organization and the other, a communication...

Related Ads

Featured