Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 376

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
If your page does not contain a BOM, you can use the
the page. If you insert the
cfprocessingdirective
tag must be the same as for the BOM; otherwise, ColdFusion issues an error.
cfprocessingdirective
The following procedure describes how ColdFusion recognizes the encoding format of a ColdFusion page.
Determine the page encoding (performed by ColdFusion)
1
Use the BOM, if specified on the page.
Adobe recommends that you use BOM characters in your files.
Use the
attribute of the
2
pageEncoding
to use this attribute, see the
Default to the JVM default file character encoding. By default, this is the operating system default character
3
encoding.
Determining the page encoding of server output
Before ColdFusion can return a response to the client, it must determine the encoding to use for the data in the
response. By default, ColdFusion returns character data using the Unicode UTF-8 format.
ColdFusion pages (.cfm pages) default to using the Unicode UTF-8 format for the response, even if you include the
HTML
tag in the page. Therefore, the following example doesnot modify the character set of the response:
meta
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type"
content="text/html;
charset="Shift_JIS">
</head>
...
In this example, the response still uses the UTF-8 character set. Use the
However, within a ColdFusion page you can use the
response. Use the
attribute of the
type
character set, as follows:
<cfcontent type="text/html charset=EUC-JP">
Note: ColdFusion also provides attributes that let you specify the encoding of specific elements, such as HTTP requests,
request headers, files, and mail messages. For more information, see
encoding" on page 372 and
"Handling data in
The rest of this chapter describes ColdFusion tags and functions that you use for globalization, and discusses specific
globalization issues.
Tags and functions for globalizing applications
ColdFusion supplies many tags and functions that you can use to develop globalized applications.
cfprocessingdirective
tag on a page that has a BOM, the information specified by the
cfprocessingdirective
tag in the CFML Reference.
cfprocessingdirective
cfcontent
tag to specify the MIME type of the page output, including the
cfcontent
ColdFusion" on page 374.
Last updated 1/20/2012
tag to set the character encoding of
tag, if specified. For detailed information on how
tag to set the output character set.
cfcontent
tag to override the default character encoding of the
"Tags and functions for controlling character
371

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents