Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 375

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
<p>LSCurrencyFormat returns a currency value using the locale convention.
<!--- loop through list of locales; show currency values for 100,000 units --->
<cfloop LIST = "#Server.Coldfusion.SupportedLocales#"
index = "locale" delimiters = ",">
<cfset oldlocale = SetLocale(locale)>
<cfoutput><p><b><I>#locale#</I></b><br>
Local: #LSCurrencyFormat(100000, "local")#<br>
International: #LSCurrencyFormat(100000, "international")#<br>
None: #LSCurrencyFormat(100000, "none")#<br>
<hr noshade>
</cfoutput>
</cfloop>
This example uses the ColdFusion variable
supported ColdFusion locales.
Processing a request in ColdFusion
When ColdFusion receives an HTTP request for a ColdFusion page, ColdFusion resolves the request URL to a physical
file path and reads the file contents to parse it. A ColdFusion page can be encoded in any character encoding supported
by the JVM used by ColdFusion, but need to be specified so that ColdFusion can identify it.
The content of the ColdFusion page on the server can be static data (typically HTML and plain text not processed by
ColdFusion), and dynamic content written in CFML. Static content is written directly to the response to the browser,
and dynamic content is processed by ColdFusion.
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.
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 are described as follows:
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. 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 Dreamweaver, which automatically sets the BOM
based on the Page Properties Document Encoding selection.
Server.Coldfusion.SupportedLocales
BOM signature
EF BB BF
FE FF
FF FE
Last updated 1/20/2012
, which contains a list of all
370

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents