Name

cfprocessingdirective

Synopsis

<cfprocessingdirective>
CFML
[</cfprocessingdirective>]

Specifies a compiler processing option to suppress all whitespace produced by ColdFusion within the cfprocessingdirective tag pairs. In ColdFusion MX, a new attribute called pageencoding was added, allowing you to specify a character encoding to use to read the page. cfprocessingdirective tags must occur in matched pairs (i.e., have an end tag) when used to suppress whitespace (this is not necessary if you are only setting the page encoding) and may also be nested. cfprocessingdirective settings don’t apply to templates called via cfimport, cfobject, cfinvoke, cfinclude, or cfmodule or as custom tags. Macromedia recommends using either the suppresswhitespace attribute or the pageencoding attribute within a single cfprocessingdirective tag, but not both at the same time.

Attribute

pageencoding=" character_set "

New in ColdFusion MX. Specifies a Java character set for ColdFusion to use when reading the contents of the page. The most common character sets are UTF-8 (the default), UTF-16, UTF-16BE, UTF-16LE, US-ASCII, and ISO-8859-1. You may use any character set supported by your JRE. Optional. If the pageencoding attribute is used, the following guidelines apply:

  • The cfprocessingdirective tag can not be used within a conditional statement (cfif or cfcase) because it’s evaluated when ColdFusion compiles the page, not at runtime.

  • If there are multiple cfprocessingdirective tags within a page that ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.