User Guide

Table Of Contents
Handling data in ColdFusion MX 417
Supporting the euro
The euro is the currency of many European countries, and ColdFusion supports the reading and
writing of correctly formatted euro values. Unlike other supported currencies, the euro is not tied
to any single country (or locale). The
LSCurrencyFormat and LSParseCurrency functions rely
on the underlying JVM for their operations, and the rules used for currencies depend on the
JVM. For Sun JVMs, the 1.3 releases did not support euros and used the older country-specific
currencies. The 1.4 releases use euros for all currencies that are in the euro zone as of 2002. If you
are using a JVM that does not support the euro, use the
LSEuroCurrencyFormat and
LSParseEuroCurrency functions to format and parse euro values in locales that use euros as their
currency.
Input data from URLs and HTML forms
A web application server receives character data from request URL parameters or as form data.
The HTTP 1.1 standard only allows US-ASCII characters (0-127) for the URL specification and
for message headers. This requires a browser to encode the non-ASCII characters in the URL,
both address and parameters, by escaping (URL encoding) the characters using the “%xx
hexadecimal format. URL encoding, however, does not determine how the URL is used in a web
document. It only specifies how to encode the URL.
Form data uses the message headers to specify the encoding used by the request (Content headers)
and the encoding used in the response (Accept headers). Content negotiation between the client
and server uses this information.
This section contains suggestions on how you can handle both URL and form data entered in
different character encodings.
Handling URL strings
URL requests to a server often contain name/value pairs as part of the request. For example, the
following URL contains name/value pairs as part of the URL:
http://company.com/prod_page.cfm?name=Stephen;ID=7645
As discussed previously, URL characters entered using any character encoding other than US-
ASCII are URL-encoded in a hexadecimal format. However, by default, a web server assumes that
the characters of a URL string are single-byte characters.
One common method used to support non-ASCII characters within a URL is to include a name/
value pair within the URL that defines the character encoding of the URL. For example, the
following URL uses a parameter called encoding to define the character encoding of the URL
parameters:
http://company.com/prod_page.cfm?name=Stephen;ID=7645;encoding=Latin-1
Within the prod_page.cfm page, you can check the value of the encoding parameter before
processing any of the other name/value pairs. This guarantees that you will handle the parameters
correctly.