Accessibility
 
Home > Products > ColdFusion > Support > Internationalization
ColdFusion Icon Macromedia ColdFusion Support Center - Internationalization
Internationalized application development tips

This section provides suggestions for developers of internationalized applications.

 
Using UTF-8 and a BOM
Macromedia recommends that you use UTF-8 character encoding with ColdFusion MX. With this encoding, the application can render all languages, regardless of locale values. ColdFusion MX automatically recognizes the BOM, so you do not use the cfprocessingdirective tag in your pages. The ColdFusion MX default output encoding for HTTP is UTF-8.

Although it is probably not possible to completely migrate a ColdFusion 5 application to UTF-8, you should code new applications in UTF-8 because of its ease of use and simplicity. Macromedia Dreamweaver MX stores files as UTF-8 automatically and uses a BOM to mark them.

 
The setEncoding function and cfcontent tag in an application.cfm file
A simple way to migrate an application is to put setEncoding and cfcontent calls into the application.cfm file. This ensures that all pages function the same way and lets you avoid changing ColdFusion code. The effect of a cfprocessingdirective tag on an Application.cfm file does not propagate through an application. You must add it to each file that has a different encoding than the default or that does not have a BOM.

 
Internationalizing database access
The following procedure explains how to set up a ColdFusion database to accept and process double-byte data.

To use double-byte data with a MS Access database, you must do the following:

1 On the server computer, run the batch file cfusionmx\db\slserver52\admin\setcp.bat OS. (This file is installed with ColdFusion MX.)
2 Restart the ColdFusion MX ODBC Server.
The DataDirect SequeLink Type III database drivers (ODBC Socket) that are used to connect to Microsoft Access databases do not support Unicode. The installed driver uses the operating system default character encoding.

 
CFX functions
To use CFX functionality with double-byte data, you must download and replace the cfxneo.dll file. This file will be available on the ColdFusion Support site in August, 2002; to locate it, search for an article with the filename.

 
Multipart POST
When submitting data through a form using the post method, if you use the form attribute value enctype= "multipart/form-data" , ColdFusion does not handle character encoding correctly. Instead, use code such as the following:

<form action="#FOO#" 
	method="post" 
	enctype="multipart/form-data: charset=utf-8">

 
Included pages and custom tags
The cfprocessingdirective tag does not permit included pages and custom tags in the calling page. You must add the cfprocessingdirective tag to the included page.

 
Components
To output non-ASCII text from a component with the cfoutput tag, put a cfprocessingdirective tag within the cfcomponent tag. For an example of the cfprocessingdirective tag, see the code in Reading a ColdFusion page with a nondefault character encoding.

 
Dates
ColdFusion MX uses Java standard date and time value formatting. In ColdFusion MX, you can use LS* functions (for example, LSCurrencyFormat) only with dates that are formatted in the Java standard for the current locale. To determine the correct format, use the now function to display a value. To ensure correct handling, create a date/time object for each value.

For more information on locales and ColdFusion MX, see Article 9943.

 
Verity
The Verity functions use the operating system default encoding. To use data that is in a language other than the operating system native language, you must encode in UTF-8. If the language is native to the operating system, use the operating system default encoding. For example, on a computer with Windows Japanese, to use Japanese data, encode in Shift_JIS; on a computer with Windows English, to use Japanese data, encode in UTF-8.

To Table of Contents Back to Previous document Forward to next document