Provides the following insformation to ColdFusion on how to process the current page:
<cfprocessingdirective
pageencoding = "page-encoding literal string" />
or
<cfprocessingdirective
suppressWhiteSpace = "Yes" or "No"
pageEncoding = "page-encoding literal string">
CFML tags
</cfprocessingdirective>
cfcol
,
cfcontent
,
cfoutput
,
cfsetting
,
cfsilent
,
cftable
,
SetEncoding
,
Developing Globalized Applications in Developing ColdFusion MX Applications
ColdFusion MX:
suppresswhitespace
attribute value behavior: you can specify the suppresswhitespace
attribute value as a string variable. (ColdFusion 5 supported setting it only as a constant.) pageEncoding
attribute.Attribute | Req/Opt | Default | Description |
---|---|---|---|
suppressWhiteSpace |
Optional |
|
Boolean; whether to suppress white space characters within the |
pageEncoding |
Optional |
Character encoding identified by the page byte order mark, if any; otherwise, system default encoding |
A string literal; cannot be a variable. Identifies the character encoding of the current CFML page. This attribute affects the entire page, not just the The following list includes commonly used values::
For more information on character encodings, see: |
The cfprocssingdirective
tag has limitations that depend on the attribute you use. For this reason, Macromedia recommends that you include either the pageencoding
or suppresswhitespace
attribute in a cfprocessingdirective
tag, not both. To specify both values, use separate tags.
If you use the pageEncoding
attribute, the following rules apply:
cfsetting
or cfsilent
tag.cfinclude
or cfmodule
tags, custom tag invocation, and so on, the tag has no effect on the included pages.pageEncoding
attribute is evaluated when ColdFusion compiles a page (not when it executes the page). For example, the following code has no effect at execution time, because the cfprocessingdirective
tag has already been evaluated: <cfif dynEncoding is not "dynamic encoding is not possible"> <cfprocessingdirective pageencoding=#dynEncoding#> </cfif>
cfprocessingdirective
tags in one page that specify the pageEncoding
attribute, they must all specify the same value; if not, ColdFusion throws an error.pageencoding
attribute, do not use a separate end tag.pageengoding
attribute specifies an encoding that differs from the BOM, ColdFusion generates an error.The following rules apply to the suppressWhiteSpace
attribute:
suppresswhitespace
attribute value as a constant or a variable. To use a variable: define the variable (for example, whitespaceSetting
), assign it the value "Yes
" or "No
", and code a statement such as the following: <!--- ColdFusion allows suppression option to be set at runtime --->
<cfprocessingdirective suppresswhitespace=#whitespaceSetting#>
code to whose output the setting is applied
</cfprocessingdirective>
suppresswhitespace
attribute only affects code that you put between the <cfprocessingdirective>
begin tag and the </cfprocessingdirective>
end tag.The following example shows the use of a nested cfprocessingdirective
tag. The outer tag suppresses unnecessary whitespace during computation of a large table; the inner tag retains whitespace, to output a preformatted table.
<cfprocessingdirective suppressWhiteSpace = "Yes"><!---
CFML code--->
<cfprocessingdirective suppressWhiteSpace = "No"> <cfoutput>#table_data# </cfoutput> </cfprocessingdirective> </cfprocessingdirective>
The following example shows the use of the pageencoding
attribute:
<cfprocessingdirective pageencoding = "shift_jis">