After strugling with the French language where my database-words where displayed correctly but my .php files not and when i changed the CHARSET of my pages it just changed the problem (Mysql data displayed wrong and the PHP correct) i finaly found out what was causing this problem.
For the French language this works in french.php (/includes/languages/YOUR_LANGUAGE.php)
Code:
// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat try 'en_US'
// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'
@setlocale(LC_TIME, 'ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
}
}
// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'EUR');
// Global entries for the <html> tag
define('HTML_PARAMS','dir="ltr" lang="fr"');
define('LANGUAGE_CODE', 'fra');
// charset for web pages and emails
define('CHARSET', 'ISO_8859-1');
BUT THAT IS NOT ALL !!
If you are using ISO_8859-1, make sure you are saving your .php files as ANSI and not UTF-8!! (UTF-8 should only be used if you're also setting CHARSET to UTF-8 )
Within notepad for example you can select this when you choose "save as" and then select the dropdown "coding".
I specialy had to do this with some .php files i received by email from a collegue.
Bookmarks