Accessibility

TechNote (Archived)

ColdFusion MX (Unix): How to check or change character encoding at the operating system level

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 ascffile. For more information on these tags, see the Developing Globalized Applications chapter on LiveDocs.

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


AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_19230
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:DB2
Informix
MySQL
Oracle
SQL Server
Sybase
MS Access

Products Affected:

coldfusion