From e8816411c433d179e9ab5219c2aec5e4a1a0dcb7 Mon Sep 17 00:00:00 2001 From: gustavf Date: Fri, 24 Mar 2000 11:35:51 +0000 Subject: [PATCH] Made page encoding a function if the users selected language. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@328 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/i18n.php | 15 +++++++-------- functions/page_header.php | 12 +++++++----- src/options.php | 11 +++++++---- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/functions/i18n.php b/functions/i18n.php index 54d65e1f..13c31124 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -14,14 +14,13 @@ $i18n_php = true; // This array specifies the available languages. - $languages[0]["NAME"] = "English"; - $languages[0]["CODE"] = "en"; - $languages[1]["NAME"] = "Norsk"; - $languages[1]["CODE"] = "no"; - $languages[2]["NAME"] = "Deutcsh"; - $languages[2]["CODE"] = "de"; - $languages[2]["NAME"] = "Russian KOI8-R"; - $languages[2]["CODE"] = "ru"; + $languages["en"]["NAME"] = "English"; + $languages["no"]["NAME"] = "Norsk"; + $languages["no"]["CHARSET"] = "iso-8859-1"; + $languages["de"]["NAME"] = "Deutcsh"; + $languages["de"]["CHARSET"] = "iso-8859-1"; + $languages["ru"]["NAME"] = "Russian KOI8-R"; + $languages["ru"]["CHARSET"] = "koi8-r"; // Decodes a string to the internal encoding from the given charset function charset_decode ($charset, $string) { diff --git a/functions/page_header.php b/functions/page_header.php index fb92f887..849dd81f 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -10,11 +10,8 @@ if (!isset($prefs_php)) include ("../functions/prefs.php"); - - // This is done to ensure that the character set is correct when - // receiving input from HTTP forms - if ($default_charset != "") - header ("Content-Type: text/html; charset=$default_charset"); + if (!isset($i18n_php)) + include ("../functions/i18n.php"); // Check to see if gettext is installed if (function_exists("_")) { @@ -25,6 +22,7 @@ putenv("LANG=$squirrelmail_language"); bindtextdomain("squirrelmail", "../locale/"); textdomain("squirrelmail"); + $default_charset = $languages[$squirrelmail_language]["CHARSET"]; // Setting cookie to use on the login screen the next time the // same user logs in. @@ -37,6 +35,10 @@ } } + // This is done to ensure that the character set is correct. + if ($default_charset != "") + header ("Content-Type: text/html; charset=$default_charset"); + function displayPageHeader($color, $mailbox) { /** Here is the header and wrapping table **/ $shortBoxName = readShortMailboxName($mailbox, "."); diff --git a/src/options.php b/src/options.php index 83d58fb4..425311af 100644 --- a/src/options.php +++ b/src/options.php @@ -90,13 +90,16 @@ echo " "; echo " "; + echo " "; echo " "; echo ""; -- 2.25.1