Provides the following information to ColdFusion about how to process the current page:
pageencoding = "page-encoding literal string"> OR <cfprocessingdirective pageEncoding = "page-encoding literal string" suppressWhiteSpace = "yes|no"> CFML tags </cfprocessingdirective>
ColdFusion MX:
ColdFusion 11:
Attribute |
Req/Opt |
Default |
Description |
---|---|---|---|
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 cfprocessingdirective tag body. The value may be enclosed in single- or double-quotation marks, or none.
|
suppressWhiteSpace |
Optional |
|
Boolean; whether to suppress white space characters within the cfprocessingdirective block that are generated by CFML tags and often do not affect HTML appearance. Does not affect any white space in HTML code. |
The cfprocssingdirective tag has limitations that depend on the attribute you use. For this reason, Adobe recommends that you include either the pageencoding or suppresswhitespace attribute in a cfprocessingdirective tag, not both. To specify both values, use separate tags.
In a ColdFusion component (.cfc file), the cfprocessingdirective tag must follow the cfcomponent tag.
If you use the pageEncoding attribute, the following rules apply:
You cannot embed the tag within conditional logic, because the 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 cfprocessingdirectivetag has already been evaluated:
<cfprocessingdirective pageencoding=#dynEncoding#> </cfif>
You can specify the 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:
<cfprocessingdirective suppresswhitespace=#whitespaceSetting#> code to whose output the setting is applied </cfprocessingdirective>
<!--- 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">
Sign in to your account