Logo Help Center

Error in Enterprise Server 9: 'The locale could not be set to English'

Error in Enterprise Server 9: 'The locale could not be set to English'

Issue

The following error appears:

ERROR: The locale could not be set to US English.

Analysis

Enterprise Server attempts to set the locale (the setting used for all language and country dependent notations such as numbers, characters, dates and so on) to US English to prevent encoding and language problems on non-english operating systems. If Enterprise Server cannot change the locale to US English this error appears.

Solution

Step 1. Find the correct locale code for US/English UTF-8 on your system by referring to this list of codes: http://msdn.microsoft.com/en-us/library/39cwe7zf%28vs.71%29.aspx.

Note: Support for 3-character language codes is limited as described on that page, and should only be used if no other alternative works.

Step 2. Open the config.php file for Enterprise Server.

Step 3. Locate the following line:

// Attempt to set the locale to US/English, if this fails display an error.
if( setlocale( LC_ALL, array('en_US.UTF-8', 'en_US.UTF8', 'us')) === false ) { // Macintosh, Linux, Windows
    echo 'ERROR: The locale could not be set to US English.<br/>';
    echo 'Please check your config.php file for instructions.<br/>';
    die();
}

The second parameter in the IF statement lists an array of locale ID’s. Upon running the code, the system will attempt to set any of these as the locale, starting from left to right. If the locale is not accepted the next one is tried, and so on.

Step 4. Add the required locale's to the statement.

Example: Should we wish to add another variant for Windows ‘enu’, the beginning of the code would look as follows:

if( setlocale( LC_ALL, array('en_US.UTF-8', 'en_US.UTF8', 'us', 'enu')) === false ) {

Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.