Determining The Character Encoding Of A Coldfusion Page - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

The default language of a website might be different from that of the person connecting to it. For
example, you could connect to an English website from a French computer. When ColdFusion
generates a response, the response must be formatted in the way expected by the customer. This
includes both the character set of the response and the locale.
This section describes how ColdFusion determines the character set of the files that it processes,
and how it determines the character set and locale of its response to the client.

Determining the character encoding of a ColdFusion page

When a request for a ColdFusion page occurs, ColdFusion opens the page, processes the content,
and returns the results back to the browser of the requestor. In order to process the ColdFusion
page, though, ColdFusion has to interpret the page content.
One piece of information used by ColdFusion is the Byte Order Mark (BOM) in a ColdFusion
page. The BOM is a special character at the beginning of a text stream that specifies the order of
bytes in multibyte characters used by the page. The following table lists the common BOM
values:
Encoding
UTF-8
UTF-16 Big Endian
UTF-16 Little Endian
To insert a BOM character in a CFML page easily, your editor must support BOM characters.
Many web page development tools support insertion of these characters, including Macromedia
Dreamweaver MX, which automatically sets the BOM based on the Page Properties Document
Encoding selection.
If your page does not contain a BOM, you can use the
character encoding of the page. If you insert the
a BOM, the information specified by the
the BOM; otherwise, ColdFusion issues an error.
The following procedure describes how ColdFusion recognizes the encoding format of a
ColdFusion page.
To determine the page encoding (performed by ColdFusion):
Use the BOM, if specified on the page.
1
Macromedia recommends that you use BOM characters in your files.
Use the
2
pageEncoding
information on how to use this attribute, see the
Reference.
Default to the JVM default file character encoding. By default, this is the operating system
3
default character encoding. To specify the JVM default file character encoding, use the
-Dfile.encoding= switch
Java and JVM Settings page.
378
Chapter 17: Developing Globalized Applications
BOM signature
EF BB BF
FE FF
FF FE
cfprocessingdirective
attribute of the
cfprocessingdirective
in the JVM Arguments field of the ColdFusion MX Administrator
cfprocessingdirective
cfprocessingdirective
tag must be the same as for
tag, if specified. For detailed
cfprocessingdirective
tag to set the
tag on a page that has
tag in CFML

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents