Revision: 2152
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2152&view=rev
Author:   cimorrison
Date:     2011-10-31 07:23:48 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Got rid of the $mail_charset config variable.   All emails now sent as UTF-8.

Modified Paths:
--------------
    mrbs/trunk/web/functions_mail.inc
    mrbs/trunk/web/internalconfig.inc.php
    mrbs/trunk/web/systemdefaults.inc.php

Modified: mrbs/trunk/web/functions_mail.inc
===================================================================
--- mrbs/trunk/web/functions_mail.inc   2011-10-25 10:20:40 UTC (rev 2151)
+++ mrbs/trunk/web/functions_mail.inc   2011-10-31 07:23:48 UTC (rev 2152)
@@ -22,46 +22,10 @@
   require_once "functions_ical.inc";
 }
 
-// {{{ convertToMailCharset()
 
-/**
- * Convert already utf-8 encoded strings to charset defined for mails in
- * config.inc.php.
- *
- * @param string    $string   string to convert
- * @return string   $string   string converted to $mail_charset, or in
- *                            original UTF-8 if mail_charset isn't set.
- */
-
-function convertToMailCharset($string)
-{
-  global $mail_charset;
-  //
-  if (isset($mail_charset) &&
-      (strcasecmp($mail_charset, "utf-8") != 0))
-  {
-    return iconv("utf-8", $mail_charset, $string);
-  }
-  else
-  {
-    return $string;
-  }
-}
-
-
 function get_mail_charset()
 {
-  global $mail_charset;
-
-  if (isset($mail_charset))
-  {
-    $charset = $mail_charset;
-  }
-  else
-  {
-    $charset = "utf-8";
-  }
-  return $charset;
+  return 'utf-8';
 }
 
 function get_mail_vocab($token)
@@ -70,9 +34,7 @@
 
   $string = get_vocab($token, $mail_vocab);
 
-  $unescaped_string = str_replace(' ', ' ', $string);
-
-  return convertToMailCharset($unescaped_string);
+  return str_replace(' ', ' ', $string);
 }
 
 // Get localized (for email) field name for a user defined table column
@@ -137,16 +99,16 @@
   {
     if ($twentyfourhour_format)
     {
-      return mail_strftime($strftime_format['datetime24'], $t);
+      return utf8_strftime($strftime_format['datetime24'], $t);
     }
     else
     {
-      return mail_strftime($strftime_format['datetime12'], $t);
+      return utf8_strftime($strftime_format['datetime12'], $t);
     }
   }
   else
   {
-    return mail_strftime($strftime_format['date'], $t);
+    return utf8_strftime($strftime_format['date'], $t);
   }
 }
 
@@ -167,13 +129,6 @@
 }
 
 
-function mail_strftime($format,$t)
-{
-  $string = utf8_strftime($format,$t);
-  return convertToMailCharset($string);
-}
-
-
 // Splits an email address of the form 'common_name <address>',
 // '"common_name" <address>' or just 'address' into a common name and an 
address.
 // Returns the result as an array index by 'common_name' and 'address'.
@@ -482,7 +437,7 @@
     $body .= "</style>\n";
     $body .= "</head>\n";
     $body .= "<body id=\"mrbs\">\n";
-    $body .= "<div id=\"header\">" . convertToMailCharset($mrbs_company) . " - 
" . get_mail_vocab("mrbs") . "</div>\n";
+    $body .= "<div id=\"header\">" . $mrbs_company . " - " . 
get_mail_vocab("mrbs") . "</div>\n";
     $body .= "<div id=\"contents\">\n";
   }
   $body .= ($as_html) ? "<p>" : "";
@@ -495,7 +450,7 @@
       $body .= get_mail_vocab("mail_body_more_info");
       $body .= ($as_html) ? "</p><p>" : "\n\n";
       $body .= get_mail_vocab("info_requested") . ": ";
-      $body .= convertToMailCharset($note);
+      $body .= $note;
       break;
     case "remind":
       $body .= get_mail_vocab("mail_body_reminder");
@@ -504,7 +459,7 @@
       $body .= get_mail_vocab("mail_body_rej_entry");
       $body .= ($as_html) ? "</p><p>" : "\n\n";
       $body .= get_mail_vocab("reason") . ': ';
-      $body .= convertToMailCharset($note);
+      $body .= $note;
       break;
     case "delete":
       $body .= get_mail_vocab("mail_body_del_entry");
@@ -513,7 +468,7 @@
       // be the same as the creator)
       $body .= get_mail_vocab("deleted_by") . ': ';
       $user = getUserName();
-      $body .= convertToMailCharset($user);
+      $body .= $user;
       break;
     default:
       if ($compare)
@@ -547,7 +502,7 @@
     {
       $body .= "&series=1";
     }
-    $body .= ($as_html) ? "\">" . convertToMailCharset($data['name']) . "</a>" 
: "";
+    $body .= ($as_html) ? "\">" . $data['name'] . "</a>" : "";
   }
   $body .= ($as_html) ? "</p>\n" : "\n\n";
   
@@ -568,8 +523,8 @@
   
   // Always display the brief description
   $body .= create_body_table_row (get_mail_vocab("namebooker"),
-                                  convertToMailCharset($data['name']),
-                                  convertToMailCharset($mail_previous['name']),
+                                  $data['name'],
+                                  $mail_previous['name'],
                                   $compare, $as_html);
   
   // Displays/don't displays entry details
@@ -577,8 +532,8 @@
   {
     // Description:
     $body .= create_body_table_row (get_mail_vocab("description"),
-                                    convertToMailCharset($data['description']),
-                                    
convertToMailCharset($mail_previous['description']),
+                                    $data['description'],
+                                    $mail_previous['description'],
                                     $compare, $as_html);
                                                                                
          
     if ($confirmation_enabled)
@@ -649,8 +604,8 @@
                                          
     // Created by
     $body .= create_body_table_row (get_mail_vocab("createdby"),
-                                    convertToMailCharset($data['create_by']),
-                                    
convertToMailCharset($mail_previous['create_by']),
+                                    $data['create_by'],
+                                    $mail_previous['create_by'],
                                     $compare, $as_html);
                      
     // Custom fields
@@ -683,8 +638,8 @@
           }
         }
         $body .= create_body_table_row (get_mail_field_name($tbl_entry, $key),
-                                        convertToMailCharset($value),
-                                        
convertToMailCharset($mail_previous[$key]),
+                                        $value,
+                                        $mail_previous[$key],
                                         $compare, $as_html);
       }
     }

Modified: mrbs/trunk/web/internalconfig.inc.php
===================================================================
--- mrbs/trunk/web/internalconfig.inc.php       2011-10-25 10:20:40 UTC (rev 
2151)
+++ mrbs/trunk/web/internalconfig.inc.php       2011-10-31 07:23:48 UTC (rev 
2152)
@@ -43,6 +43,7 @@
 
 // $highlight_method
 // $javascript_cursor
+// $mail_charset
 
 
 /********************************************************

Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php       2011-10-25 10:20:40 UTC (rev 
2151)
+++ mrbs/trunk/web/systemdefaults.inc.php       2011-10-31 07:23:48 UTC (rev 
2152)
@@ -782,12 +782,8 @@
                                      // periods and time of day, so the 
calendar would not
                                      // be able to import the booking)
 
-// HOW TO EMAIL - CHARACTER SET AND LANGUAGE
+// HOW TO EMAIL - LANGUAGE
 // -----------------------------------------
-// You can override the charset used in emails if you like, but be sure
-// the charset you choose can handle all the characters in the translation
-// and that anyone may use in a booking description
-//$mail_charset = "iso-8859-1";
 
 // Set the language used for emails (choose an available lang.* file).
 $mail_settings['admin_lang'] = 'en';   // Default is 'en'.

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to