[ConvertChars]Any Text[/ConvertChars]

Changes 'illegal' characters into legal HTML.

To automatically convert certain characters such as the trademark symbol, copyright symbol, or curly-quotes into valid HTML, put the text inside a [ConvertChars] context. The illegal letters will be converted to legal HTML, such as (tm), © or " (straight quotes).

Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):

[ConvertChars]Some Text that contains © or other unusual letters[/ConvertChars]

Try It!

The above line of WebDNA would produce the following:

Some Text that contains © or other unusual letters

Anywhere the illegal characters appear inside the context, they will be converted to equivalent HTML. You may put any [xxx] tags inside the context--for instance, you may use fields from a database, or even [include] the entire contents of another file. The character conversions are controlled by WebCatalog's preference settings.

To add your own conversions, edit the StandardConversions.db file and enter the character to be converted followed by a tab and the text you want to replace that letter with (up to 63 characters).

New for 2.1: You may optionally specify an alternate database which contains a list of character conversions:

[ConvertChars db=MyConversions.db]...[/ConvertChars]

This gives you the ability to do different conversions, such as multiple ISO character sets, in different languages. The database must be of the following form:

--- MyConversions.db ---
from<tab>to
%0B<tab><BR>
%0D<tab><P>
©<tab>&copy;
ô<tab><sup><font size=-1>TM</font></sup>

Notice that you can use escaped-ASCII to specify characters such as Carriage Return (%0D), Soft-Return (%0B), Tab (%09), etc. The text in the from column must be only 1 character, while the text in the to column may be as many as 63 characters.