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

New for 3.0: normally all database filepaths are relative to the local template, or if they begin with "/" they are relative to the web server's virtual host root. As of version 3.0, you may optionally put "^" in front of the filepath to indicate that the file can be found in a global root folder called "Globals" inside the WebCatalog folder. This global root folder is the same regardless of the virtual host.