ConvertChars Context [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]

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 WebDNA's StandardConversions.db database file.

To add your own conversions, to be applied to all WebDNA sites running on the same machine, 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). Or, if you want to use your own conversion database to be used locally, you can use the db parameter described below

Special Cases: It may be necessary to use hex codes in your conversion database.
For example, to convert a space to a '+', your conversion database would look like this:

FROM	TO
%20	%2B

 Parameter  Description
db
(Optional) path to conversion database which contains list of "from" and "to" conversions.
 table
New for WebDNA 5.x
In place of a db file, you can specify a named reference to a WebDNA table object.

Note: Normally all database file paths are relative to the local template, or if they begin with "/" they are relative to the web server's virtual host root. You may optionally put "^" in front of the file path to indicate 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.

User Contributed Notes
ConvertCharsContext  

Copyright © 2008 WebDNA Software Corporation, Inc.