|
Internationalization tags and functions
The following table lists the tags and functions that have new internationalization functionality in ColdFusion MX.
| Tags |
Functions |
cfcontent |
setEncoding |
cffile (new charset attribute) |
setLocale |
cfhttp |
urlDecode |
cfprocessingdirective |
urlEncodedFormat |
For more information and examples, see CFML Reference and Developing ColdFusion MX Applications with CFML.
Summary of character encoding scenarios
This section summarizes typical application setups and indicates which elements to use in each.
| Setup |
Use setEncoding function |
Use cfprocessingdirective tag |
Use cfcontent tag |
| All ColdFusion pages are encoded (saved) in UTF-8 with a BOM |
setEncoding("URL", "utf-8") and/or setEncoding("FORM", "utf-8") |
No |
No |
| All ColdFusion pages use the local computer's default operating system locale value |
setEncoding("URL", "utf-8") and/or setEncoding("FORM", "utf-8") |
No |
No |
| Some or all ColdFusion pages are saved in a nondefault character encoding |
("URL", "utf-8") and/or setEncoding("FORM", "utf-8") |
<cfprocessingdirective pageencoding= " page_encoding "> |
No |
| Some or all ColdFusion pages are in default encoding but output should be in an encoding other than UTF-8 |
setEncoding("URL", " output_encoding ") and/or setEncoding("FORM", " output_encoding ") |
No |
<cfcontent type= "text/html; charset= output_encoding "> |
| Some or all ColdFusion pages are not in default encoding and output should be in an encoding other than UTF-8 |
setEncoding("URL", " output_encoding ") and/or setEncoding("FORM", " output_encoding ") |
<cfprocessingdirective pageencoding= " page_encoding "> |
<cfcontent type= "text/html; charset= output_encoding "> |
In all setups, you use the setEncoding function only in the action page of a form or page that uses a Form or URL or Form variable. If your data is ASCII encoded and you do not use the cfcontent tag, it is not necessary to use the setEncoding function, regardless of the original page encoding.
|