In general, ColdFusion MX gets its default encoding type from the operating system that it's installed on. Overriding, changing or checking this variable may be necessary if the characters displayed in the browser are not correct; for example, if Japanese characters should be displayed, but binary characters are displayed in their place. This type of scenario may occur after migrating an internationalized application to a new machine, such as moving from Red Hat Linux 7.2 server to Red Hat Linux AS 3.0 server.

Certain CFML tags can override the default encoding type, such as cfprocessingdirective or any tags that specifically provide the charset attribute, such as cffile.

In some cases, it may be preferred to change the default encoding type at the operating system level. With Unix servers, the default encoding type is set by the LANG environment variable. The following instructions provide the information needed to check and modify this variable.

Checking the operating system character encoding setting:

List encoding currently set at the operating system level:

root@ps-zin root]# locale

List encoding charsets installed or available on the system:

root@ps-zin root]# locale -a

List the environment variables currently set:

root@ps-zin root]# env

Changing the LANG variable for the Unix shell session:

root@ps-zin root]# export LANG=en_US

Implementing a permanent change:

Linux:

If /etc/sysconfig/i18n exists:

  1. Open /etc/sysconfig/i18n for editing.
  2. Change or add the following variable:



    LANG=encode type



    For example:



    LANG=en_US
  3. Save the changes to the file.

If /etc/sysconfig/i18n does not exist:

  1. Open /etc/profile for editing.
  2. Add the following line:



    export LANG=encode type



    For example:



    export LANG=en_US
  3. Save the changes to the file.

Solaris:

  1. Open /etc/TIMEZONE for editing.

    Note: This file is usually a symbolic link to /etc/default/init.
  2. Change or add the following variable:



    LANG=encode type



    For example:



    LANG=en_US
  3. Save the changes to the file.

Additional Information

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy