[icon] HTMLchars


Introduction

HTMLchars is a utility that converts any special characters in a document (eg. ©, ±, £, and accented characters) into the relevant HTML codes (or character entity names as they are known).

This is useful if you are converting a text file into HTML, or if you are writing HTML from scratch but can't remember all those codes.

Why is this necessary?

As pages on the world wide web are viewed by many people with non-Acorn computers, often using foreign character sets, special characters may not display correctly on their screens even though they look OK in your browser. HTMLchars finds these characters, and corrects them automatically. This means that you won't need to remember the entity names, and that you won't miss any characters that need altering.

Using the utility

To convert all the special characters in an HTML file, simply drag it to the HTMLchars iconbar icon. A save box will open and you can save the file in the usual way. The program also accepts text files, which means that you can convert the special characters before marking the rest of the file up in HTML.

Characters inside HTML tags and comments are not changed in any way.

IMPORTANT NOTE: it is recommended that you don't save the converted file on top of the original, so that it may be tested before the original is lost. Although I haven't experienced any problems myself, the author cannot accept responsibility for any corrupted files, so you use it at your own risk!

You can drag multiple files to the icon, and each will be processed in turn.

If there is a character in the file for which an HTML entity is not defined, a warning message will appear giving the character and ASCII code. You can then edit file by hand to remove the character, and replace it with relevant HTML tags or entities. (See also the section below on editing the entity definitions).

The setup window

This is accessed through the iconbar menu.

The window gives you the option of converting ampersands and quotation marks. Generally, you should convert ampersands and not quotation marks.

The option to convert greater/less than signs will convert all of the < and > in the file, even those forming HTML tags. This is only useful if you are converting a plain-text file, or writing an HTML tutorial!

Editing the entity definitions

HTMLchars is supplied with definitions of all the special character entities defined in HTML 3.2, plus a few additions.

The definitions are contained in the file !HTMLchars.Characters, and are in the following format:
x,entity
(where x is the character, and entity is the HTML entity).

Each definition should be on a new line.

Example:
á,&aacute;
This will replace any á in the file with &aacute;

Note that you can choose to replace a character with any text you wish instead of an entity name. For example, an ellipsis is replaced by three full stops, and smart quotes are replaced by ordinary quotes.

Quotes, ampersands and greater and less than symbols should not be included in the definition file, as they are treated specially by HTMLchars.

Download (8K)


[e-mail] [Home] [Back] Return to the software index