User Guide

Table Of Contents
408 Chapter 17: Developing Globalized Applications
Character encoding conversion issues
Because different character encodings support different character sets, you can encounter errors if
your application gets text in one encoding and presents it in another encoding. For example, the
Windows Latin-1 character encoding, Windows-1252, includes characters with hexadecimal
representations in the range 80-9F, while ISO 8859-1 does not include characters in that range.
As a result, under the following circumstances, characters in the range 80-9F, such as the euro
symbol (
Ä), are not displayed properly:
A file encoded in Windows-1252 includes characters in the range 80-9F.
ColdFusion reads the file, specifying the Windows-1252 encoding in the cffile tag.
ColdFusion displays the file contents, specifying ISO-8859 in the cfcontent tag.
Similar issues can arise if you convert between other character encodings; for example, if you read
files encoded in the Japanese Windows default encoding and display them using Shift-JIS. To
prevent these problems, ensure that the display encoding is the same as the input encoding.
Locales
A locale identifies the exact language and cultural settings to use for a user. The locale controls
how to format the following:
Dates
Times
Numbers
Currency amounts
ColdFusion MX supports all locales supported by the JVM that it uses.
Note: Current JVM versions (through 1.4.2) do not support localized numbers such as Arabic-hindic
numbers used in Arabic locales or hindic digits used in Hindi locales. ColdFusion uses Arabic
numbers in all locales.
Locale names
ColdFusion MX 7 supports two formats for specifying locale names: the standard Java locale
names and the ColdFusion naming convention that was required through ColdFusion MX 6.1.
You can specify all locales using a name consisting of the following:
Two lowercase letters to identify the language; for example, en for English, or zh for
Chinese.
Optionally, an underscore and a two uppercase letters to identify the regional variant of the
language; for example, US for the United States, or HK for Hong Kong.
For example, en_US represents United States English and es_MX represents Mexican Spanish.
For a list of the Java locale identifiers supported in the Sun 1.4.2 JVM and their meanings, see
http://java.sun.com/j2se/1.4.2/docs/guide/intl/locale.doc.html.
Prior to ColdFusion MX 7, ColdFusion supported a limited set of locales, and used identifiers
that consisted of the name of the language, followed, for most languages, by a regional
identifier in parentheses, such as English (US) or German (Standard). ColdFusion MX
continues to support these names; for a list, see
SetLocale in CFML Reference.