From: Jan Schneider Date: Sun, 3 Oct 2010 17:35:19 +0000 (+0200) Subject: Require to pass target charset to convertCharset(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fc55d6178d33ca825f59a1a2eba44c8c7daa6019;p=horde.git Require to pass target charset to convertCharset(). --- diff --git a/agora/lib/Messages.php b/agora/lib/Messages.php index fb9e43691..920fffc4b 100644 --- a/agora/lib/Messages.php +++ b/agora/lib/Messages.php @@ -2210,7 +2210,7 @@ class Agora_Messages { */ public function convertFromDriver($value) { - return Horde_String::convertCharset($value, $this->_params['charset']); + return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8'); } /** diff --git a/agora/scripts/phorum2agora.php b/agora/scripts/phorum2agora.php index 8f0ae2be4..f1343ed58 100755 --- a/agora/scripts/phorum2agora.php +++ b/agora/scripts/phorum2agora.php @@ -119,8 +119,8 @@ foreach ($messages as $message) { $params[] = makeParents($message['thread'], $message['message_id']); $params[] = ($message['thread'] == $message['message_id']) ? 0 : $message['thread']; $params[] = $message['author']; - $params[] = Horde_String::convertCharset($message['subject'], $conf['sql']['charset']); - $params[] = Horde_String::convertCharset($message['body'], $conf['sql']['charset']); + $params[] = Horde_String::convertCharset($message['subject'], $conf['sql']['charset'], 'UTF-8'); + $params[] = Horde_String::convertCharset($message['body'], $conf['sql']['charset'], 'UTF-8'); $params[] = $message['datestamp']; $params[] = 0; $params[] = $message['ip']; diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php index f97d5021b..2e780df20 100644 --- a/ansel/lib/Image.php +++ b/ansel/lib/Image.php @@ -1201,7 +1201,7 @@ class Ansel_Image Implements Iterator if (!isset($attributes[$field])) { continue; } - $value = Horde_Image_Exif::getHumanReadable($field, Horde_String::convertCharset($attributes[$field], $GLOBALS['conf']['sql']['charset'])); + $value = Horde_Image_Exif::getHumanReadable($field, Horde_String::convertCharset($attributes[$field], $GLOBALS['conf']['sql']['charset'], 'UTF-8')); if (!$format) { $output[$field] = $value; } else { diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 14887513b..3404f7ffc 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -470,8 +470,8 @@ class Ansel_Storage Horde::logMessage($image, 'ERR'); throw new Ansel_Exception($image); } else { - $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset']); - $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset']); + $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset'], 'UTF-8'); + $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset'], 'UTF-8'); $this->_images[$id] = new Ansel_Image($image); return $this->_images[$id]; @@ -626,8 +626,8 @@ class Ansel_Storage $return = array(); while ($image = $images->fetchRow(MDB2_FETCHMODE_ASSOC)) { - $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset']); - $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset']); + $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset'], 'UTF-8' + $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset'], 'UTF-8'); $return[$image['image_id']] = new Ansel_Image($image); $this->_images[(int)$image['image_id']] = &$return[$image['image_id']]; } @@ -730,8 +730,8 @@ class Ansel_Storage } while ($image = $images->fetchRow(MDB2_FETCHMODE_ASSOC)) { - $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset']); - $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset']); + $image['image_filename'] = Horde_String::convertCharset($image['image_filename'], $GLOBALS['conf']['sql']['charset'], 'UTF-8'); + $image['image_caption'] = Horde_String::convertCharset($image['image_caption'], $GLOBALS['conf']['sql']['charset'], 'UTF-8'); $results[] = new Ansel_Image($image); } $images->free(); diff --git a/fima/lib/Driver/sql.php b/fima/lib/Driver/sql.php index 6d8fe3c73..e473c98f6 100644 --- a/fima/lib/Driver/sql.php +++ b/fima/lib/Driver/sql.php @@ -494,13 +494,13 @@ class Fima_Driver_sql extends Fima_Driver { 'owner' => $row['account_owner'], 'number' => sprintf('%\'04d', $row['account_number']), 'type' => $row['account_type'], - 'name' => Horde_String::convertCharset($row['account_name'], $this->_params['charset']), + 'name' => Horde_String::convertCharset($row['account_name'], $this->_params['charset'], 'UTF-8'), 'eo' => $row['account_eo'], - 'desc' => Horde_String::convertCharset($row['account_desc'], $this->_params['charset']), + 'desc' => Horde_String::convertCharset($row['account_desc'], $this->_params['charset'], 'UTF-8'), 'closed' => $row['account_closed'], 'label' => trim($row['account_number'] . ' ' . (($parent === null) ? '' : $parent['name'] . ' - ') . - Horde_String::convertCharset($row['account_name'], $this->_params['charset'])), + Horde_String::convertCharset($row['account_name'], $this->_params['charset'], 'UTF-8')), 'parent_id' => ($parent === null) ? null : $parent['account_id'], 'parent_number' => ($parent === null) ? '' : $parent['number'], 'parent_name' => ($parent === null) ? '' : $parent['name']); @@ -686,7 +686,7 @@ class Fima_Driver_sql extends Fima_Driver { 'date' => $row['posting_date'], 'asset' => $row['posting_asset'], 'account' => $row['posting_account'], - 'desc' => Horde_String::convertCharset($row['posting_desc'], $this->_params['charset']), + 'desc' => Horde_String::convertCharset($row['posting_desc'], $this->_params['charset'], 'UTF-8'), 'amount' => $row['posting_amount'], 'eo' => (int)(bool)$row['posting_eo']); } diff --git a/framework/Alarm/lib/Horde/Alarm/Sql.php b/framework/Alarm/lib/Horde/Alarm/Sql.php index aabe49b8d..6a7cb6461 100644 --- a/framework/Alarm/lib/Horde/Alarm/Sql.php +++ b/framework/Alarm/lib/Horde/Alarm/Sql.php @@ -407,7 +407,7 @@ class Horde_Alarm_Sql extends Horde_Alarm */ protected function _fromDriver($value) { - return Horde_String::convertCharset($value, $this->_params['charset']); + return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8'); } /** diff --git a/framework/Core/lib/Horde/Config.php b/framework/Core/lib/Horde/Config.php index f303a26b8..fe87ed5dd 100644 --- a/framework/Core/lib/Horde/Config.php +++ b/framework/Core/lib/Horde/Config.php @@ -1411,10 +1411,6 @@ class Horde_Config $ptr = $ptr[$ctx[$i]]; } - if (is_string($ptr)) { - $ptr = Horde_String::convertCharset($ptr, 'iso-8859-1'); - } - return array($ptr, false); } @@ -1604,7 +1600,7 @@ class Horde_Config return $apps; case 'list-horde-languages': - return array_map(create_function('$val', 'return preg_replace(array("/&#x([0-9a-f]{4});/ie", "/(&[^;]+;)/e"), array("Horde_String::convertCharset(pack(\"H*\", \"$1\"), \"ucs-2\", \"' . 'UTF-8' . '\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"' . 'UTF-8' . '\")"), $val);'), $GLOBALS['registry']->nlsconfig['languages']); + return array_map(create_function('$val', 'return preg_replace(array("/&#x([0-9a-f]{4});/ie", "/(&[^;]+;)/e"), array("Horde_String::convertCharset(pack(\"H*\", \"$1\"), \"ucs-2\", \"UTF-8\")", "Horde_String::convertCharset(html_entity_decode(\"$1\", ENT_COMPAT, \"iso-8859-1\"), \"iso-8859-1\", \"UTF-8\")"), $val);'), $GLOBALS['registry']->nlsconfig['languages']); case 'list-blocks': $collection = Horde_Block_Collection::singleton(); diff --git a/framework/Core/lib/Horde/Core/Factory/Prefs.php b/framework/Core/lib/Horde/Core/Factory/Prefs.php index 677426fc7..18e26db3a 100644 --- a/framework/Core/lib/Horde/Core/Factory/Prefs.php +++ b/framework/Core/lib/Horde/Core/Factory/Prefs.php @@ -81,7 +81,6 @@ class Horde_Core_Factory_Prefs 'logger' => $this->_injector->getInstance('Horde_Log_Logger'), 'password' => '', 'sizecallback' => ((isset($GLOBALS['conf']['prefs']['maxsize'])) ? array($this, 'sizeCallback') : null), - 'uicharset' => 'UTF-8', 'user' => '' ), $opts); ksort($opts); diff --git a/framework/Crypt/lib/Horde/Crypt/Pgp.php b/framework/Crypt/lib/Horde/Crypt/Pgp.php index 2f0135167..59608d324 100644 --- a/framework/Crypt/lib/Horde/Crypt/Pgp.php +++ b/framework/Crypt/lib/Horde/Crypt/Pgp.php @@ -947,7 +947,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt $charset = $lang_charset[1]; } } - throw new Horde_Crypt_Exception(sprintf(_("Connection refused to the public keyserver. Reason: %s (%s)"), Horde_String::convertCharset($errstr, $charset), $errno)); + throw new Horde_Crypt_Exception(sprintf(_("Connection refused to the public keyserver. Reason: %s (%s)"), Horde_String::convertCharset($errstr, $charset, 'UTF-8'), $errno)); } } diff --git a/framework/DataTree/DataTree.php b/framework/DataTree/DataTree.php index 6073e52f9..742c29af7 100644 --- a/framework/DataTree/DataTree.php +++ b/framework/DataTree/DataTree.php @@ -659,7 +659,7 @@ class DataTree { $cids = array(); foreach ($data as $id => $cat) { if (!is_null($charset)) { - $cat[1] = Horde_String::convertCharset($cat[1], $charset); + $cat[1] = Horde_String::convertCharset($cat[1], $charset, 'UTF-8'); } $cids[$cat[0]] = $cat[1]; $cparents[$cat[0]] = $cat[2]; diff --git a/framework/DataTree/DataTree/sql.php b/framework/DataTree/DataTree/sql.php index aee91f9f6..c730ee6d0 100644 --- a/framework/DataTree/DataTree/sql.php +++ b/framework/DataTree/DataTree/sql.php @@ -1018,7 +1018,8 @@ class DataTree_sql extends DataTree { /* Convert old data to the new format. */ if ($row[1] == Horde_Serialize::BASIC) { $data[$id] = Horde_String::convertCharset($data[$id], - $GLOBALS['registry']->getLanguageCharset()); + $GLOBALS['registry']->getLanguageCharset(), + 'UTF-8'); } $data[$id] = (is_null($data[$id]) || !is_array($data[$id])) @@ -1041,7 +1042,7 @@ class DataTree_sql extends DataTree { 'UTF-8'); /* Convert old data to the new format. */ if ($row['datatree_serialized'] == Horde_Serialize::BASIC) { - $data = Horde_String::convertCharset($data, $GLOBALS['registry']->getLanguageCharset()); + $data = Horde_String::convertCharset($data, $GLOBALS['registry']->getLanguageCharset(), 'UTF-8'); } return (is_null($data) || !is_array($data)) ? array() : $data; } @@ -1213,7 +1214,7 @@ class DataTree_sql extends DataTree { return $result; } while ($row = $result->fetchRow()) { - $rows[$row[0]] = Horde_String::convertCharset($row[1], $this->_params['charset']); + $rows[$row[0]] = Horde_String::convertCharset($row[1], $this->_params['charset'], 'UTF-8'); } } @@ -1249,7 +1250,7 @@ class DataTree_sql extends DataTree { $rows = array(); while ($row = $result->fetchRow()) { - $rows[$row[0]] = Horde_String::convertCharset($row[1], $this->_params['charset']); + $rows[$row[0]] = Horde_String::convertCharset($row[1], $this->_params['charset'], 'UTF-8'); } return $rows; diff --git a/framework/Icalendar/lib/Horde/Icalendar.php b/framework/Icalendar/lib/Horde/Icalendar.php index 8e6713132..f103a5735 100644 --- a/framework/Icalendar/lib/Horde/Icalendar.php +++ b/framework/Icalendar/lib/Horde/Icalendar.php @@ -656,10 +656,10 @@ class Horde_Icalendar $value = quoted_printable_decode($value); if (isset($params['CHARSET'])) { - $value = Horde_String::convertCharset($value, $params['CHARSET']); + $value = Horde_String::convertCharset($value, $params['CHARSET'], 'UTF-8'); } } elseif (isset($params['CHARSET'])) { - $value = Horde_String::convertCharset($value, $params['CHARSET']); + $value = Horde_String::convertCharset($value, $params['CHARSET'], 'UTF-8'); } // Get timezone info for date fields from $params. diff --git a/framework/Kolab/Kolab.php b/framework/Kolab/Kolab.php index fd21a3a64..14982b91f 100644 --- a/framework/Kolab/Kolab.php +++ b/framework/Kolab/Kolab.php @@ -568,7 +568,7 @@ class Kolab { */ function decodeImapFolderName($name) { - return Horde_String::convertCharset($name, 'UTF7-IMAP'); + return Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8'); } /** diff --git a/framework/Mime/lib/Horde/Mime/Headers.php b/framework/Mime/lib/Horde/Mime/Headers.php index d53839511..3b40b5593 100644 --- a/framework/Mime/lib/Horde/Mime/Headers.php +++ b/framework/Mime/lib/Horde/Mime/Headers.php @@ -613,7 +613,7 @@ class Horde_Mime_Headers implements Serializable continue; } if ($eightbit_check && Horde_Mime::is8bit($val[1])) { - $val[1] = Horde_String::convertCharset($val[1], self::$defaultCharset); + $val[1] = Horde_String::convertCharset($val[1], self::$defaultCharset, 'UTF-8'); } if (in_array(Horde_String::lower($val[0]), $mime)) { diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Enriched.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Enriched.php index 954dded2d..a12afe20c 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Enriched.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Enriched.php @@ -60,8 +60,8 @@ class Horde_Mime_Viewer_Enriched extends Horde_Mime_Viewer_Base protected function _renderInline() { return $this->_renderReturn( - Horde_String::convertCharset($this->_toHTML(true), $this->_mimepart->getCharset(), $this->getConfigParam('charset')), - 'text/html; charset=' . $this->getConfigParam('charset') + Horde_String::convertCharset($this->_toHTML(true), $this->_mimepart->getCharset(), 'UTF-8'), + 'text/html; charset=UTF-8' ); } diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php index b8d468f96..e5c4938d1 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Html.php @@ -96,8 +96,8 @@ class Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Base $html = $this->_cleanHTML($this->_mimepart->getContents(), array('inline' => true)); return $this->_renderReturn( - Horde_String::convertCharset($html, $this->_mimepart->getCharset(), $this->getConfigParam('charset')), - 'type' => 'text/html; charset=' . $this->getConfigParam('charset') + Horde_String::convertCharset($html, $this->_mimepart->getCharset(), 'UTF-8'), + 'type' => 'text/html; charset=UTF-8' ); } diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Plain.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Plain.php index 4dca5d3e7..83b8c4aac 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Plain.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Plain.php @@ -61,7 +61,7 @@ class Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Base */ protected function _renderInline() { - $text = Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset(), $this->getConfigParam('charset')); + $text = Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset(), 'UTF-8'); /* Check for 'flowed' text data. */ $data = ($this->_mimepart->getContentTypeParameter('format') == 'flowed') @@ -70,7 +70,7 @@ class Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Base return $this->_renderReturn( $data, - 'text/html; charset=' . $this->getConfigParam('charset') + 'text/html; charset=UTF-8' ); } diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Richtext.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Richtext.php index d2122d974..d19909218 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Richtext.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Richtext.php @@ -70,8 +70,8 @@ class Horde_Mime_Viewer_Richtext extends Horde_Mime_Viewer_Base protected function _renderInline() { return $this->_renderReturn( - Horde_String::convertCharset($this->_toHTML(), $this->_mimepart->getCharset(), $this->getConfigParam('charset')), - 'text/html; charset=' . $this->getConfigParam('charset') + Horde_String::convertCharset($this->_toHTML(), $this->_mimepart->getCharset(), 'UTF-8'), + 'text/html; charset=UTF-8' ); } diff --git a/framework/Prefs/lib/Horde/Prefs.php b/framework/Prefs/lib/Horde/Prefs.php index bfab8ab68..a65350432 100644 --- a/framework/Prefs/lib/Horde/Prefs.php +++ b/framework/Prefs/lib/Horde/Prefs.php @@ -115,7 +115,6 @@ class Horde_Prefs * 'sizecallback' - (callback) If set, called when setting a value in * the backend. * DEFAULT: NONE - * 'uicharset' - (string) UI charset. [REQUIRED] * 'user' - (string) The name of the user who owns this set of * preferences. * DEFAULT: NONE @@ -154,7 +153,7 @@ class Horde_Prefs */ protected function __construct($scope, $opts, $params) { - foreach (array('charset', 'uicharset') as $val) { + foreach (array('charset') as $val) { if (!isset($opts[$val])) { throw new InvalidArgumentException('Missing ' . $val . ' parameter.'); } @@ -637,7 +636,7 @@ class Horde_Prefs { return is_bool($value) ? $value - : Horde_String::convertCharset($value, $this->getCharset(), $this->_opts['uicharset']); + : Horde_String::convertCharset($value, $this->getCharset(), 'UTF-8'); } /** @@ -651,7 +650,7 @@ class Horde_Prefs { return is_bool($value) ? $value - : Horde_String::convertCharset($value, $this->_opts['uicharset'], $this->getCharset()); + : Horde_String::convertCharset($value, 'UTF-8', $this->getCharset()); } /** diff --git a/framework/Rampage/scripts/Horde/Rampage/rampage.php b/framework/Rampage/scripts/Horde/Rampage/rampage.php index 86fa6e328..8f588b8be 100644 --- a/framework/Rampage/scripts/Horde/Rampage/rampage.php +++ b/framework/Rampage/scripts/Horde/Rampage/rampage.php @@ -1096,7 +1096,7 @@ function field_sql2php($field) case 'mediumtext': case 'longblob': case 'longtext': - return "Horde_String::convertCharset(\$row['".$field["name"]."'], \$this->_params['charset'])"; + return "Horde_String::convertCharset(\$row['".$field["name"]."'], \$this->_params['charset'], 'UTF-8')"; // Integer types case 'bit': diff --git a/framework/Share/lib/Horde/Share/Sql.php b/framework/Share/lib/Horde/Share/Sql.php index 06f59ed04..1efa1c9a7 100644 --- a/framework/Share/lib/Horde/Share/Sql.php +++ b/framework/Share/lib/Horde/Share/Sql.php @@ -896,7 +896,7 @@ class Horde_Share_Sql extends Horde_Share foreach ($data as $key => $value) { if (substr($key, 0, 9) == 'attribute') { $data[$key] = Horde_String::convertCharset( - $data[$key], $this->_params['charset']); + $data[$key], $this->_params['charset'], 'UTF-8'); } } diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php b/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php index 582b610d5..0f9a39388 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php @@ -6,8 +6,6 @@ *
  * body_only - (boolean) Only return the body data?
  *             DEFAULT: Return the whole HTML document
- * charset - (string) The charset of the text.
- *           DEFAULT: US-ASCII
  * size - (integer) Only filter if data is below this size.
  *        DEFAULT: No default
  * 
diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index a48dd80bb..97117d912 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -8,7 +8,6 @@ * DOMDocument object and the DOMNode object. If the callback * returns non-null, add this text to the output and skip further * processing of the node. - * charset - (string) The charset of the text. * width - (integer) The wrapping width. Set to 0 to not wrap. * * diff --git a/framework/Util/lib/Horde/String.php b/framework/Util/lib/Horde/String.php index b67b5d800..dd2baeab0 100644 --- a/framework/Util/lib/Horde/String.php +++ b/framework/Util/lib/Horde/String.php @@ -53,18 +53,13 @@ class Horde_String * * @return mixed The converted input data. */ - static public function convertCharset($input, $from, $to = null, $force = false) + static public function convertCharset($input, $from, $to, $force = false) { /* Don't bother converting numbers. */ if (is_numeric($input)) { return $input; } - /* Get the user's default character set if none passed in. */ - if (is_null($to)) { - $to = self::$_charset; - } - /* If the from and to character sets are identical, return now. */ if (!$force && $from == $to) { return $input; diff --git a/hermes/entry.php b/hermes/entry.php index 615d6ff84..061bc8c96 100644 --- a/hermes/entry.php +++ b/hermes/entry.php @@ -19,7 +19,7 @@ if (!$vars->exists('id') && $vars->exists('timer')) { $timer_id = $vars->get('timer'); $timers = @unserialize($prefs->getValue('running_timers', false)); if ($timers && isset($timers[$timer_id])) { - $tname = Horde_String::convertCharset($timers[$timer_id]['name'], $prefs->getCharset()); + $tname = Horde_String::convertCharset($timers[$timer_id]['name'], $prefs->getCharset(), 'UTF-8'); $tformat = $prefs->getValue('twentyFour') ? 'G:i' : 'g:i a'; $vars->set('hours', round((float)(time() - $timer_id) / 3600, 2)); if ($prefs->getValue('add_description')) { diff --git a/hermes/lib/Application.php b/hermes/lib/Application.php index 48cd5e610..b01cf4e35 100644 --- a/hermes/lib/Application.php +++ b/hermes/lib/Application.php @@ -144,7 +144,7 @@ class Hermes_Application extends Horde_Registry_Application $tree->addNode( $parent . '__timer_' . $i, $parent, - Horde_String::convertCharset($timer['name'], $prefs->getCharset()) . sprintf(" (%s)", $hours), + Horde_String::convertCharset($timer['name'], $prefs->getCharset(), 'UTF-8') . sprintf(" (%s)", $hours), 1, false, array( diff --git a/horde/admin/sqlshell.php b/horde/admin/sqlshell.php index 65cbf9b2f..7765cc32d 100644 --- a/horde/admin/sqlshell.php +++ b/horde/admin/sqlshell.php @@ -62,14 +62,14 @@ if (isset($result)) { if ($first) { echo ''; foreach ($row as $key => $val) { - echo '' . (!strlen($key) ? ' ' : htmlspecialchars(Horde_String::convertCharset($key, $conf['sql']['charset']))) . ''; + echo '' . (!strlen($key) ? ' ' : htmlspecialchars(Horde_String::convertCharset($key, $conf['sql']['charset'], 'UTF-8'))) . ''; } echo ''; $first = false; } echo ''; foreach ($row as $val) { - echo '' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset']))) . ''; + echo '' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset'], 'UTF-8'))) . ''; } echo ''; } @@ -83,7 +83,7 @@ if (isset($result)) { echo '' . (isset($description) ? htmlspecialchars($description) : ' ') . ''; $first = false; } - echo '' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset']))) . ''; + echo '' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset'], 'UTF-8'))) . ''; } echo ''; } else { diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index 21aa1748e..dd626b25f 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -197,7 +197,6 @@ class IMP_Hooks // public function pre_sent($message, $headers) // { // // Example: Add custom headers to outgoing message. -// $charset = 'UTF-8'; // $custom_hdrs = array(); // $hdr_charset = $message->getHeaderCharset(); // @@ -213,7 +212,7 @@ class IMP_Hooks // $custom_hdrs['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT']; // // foreach ($custom_hdrs as $key => $val) { -// $headers->addHeader($key, Horde_String::convertCharset($val, $charset, $hdr_charset)); +// $headers->addHeader($key, Horde_String::convertCharset($val, 'UTF-8', $hdr_charset)); // } // } diff --git a/imp/config/prefs.php.dist b/imp/config/prefs.php.dist index 4b95072be..568cce629 100644 --- a/imp/config/prefs.php.dist +++ b/imp/config/prefs.php.dist @@ -94,7 +94,7 @@ $_prefs['sent_mail_folder'] = array( // If the mailbox value contains non-ASCII characters, it must be encoded // in the UTF7-IMAP charset (RFC 3501 [5.1.3]). This entry will do the // necessary conversion. - // 'value' => Horde_String::convertCharset('Sent', null, 'UTF7-IMAP'), + // 'value' => Horde_String::convertCharset('Sent', 'UFT-8', 'UTF7-IMAP'), // Exchange servers use this default value instead. // 'value' => 'Sent Items' ); @@ -138,7 +138,7 @@ $_prefs['drafts_folder'] = array( // If the mailbox value contains non-ASCII characters, it must be encoded // in the UTF7-IMAP charset (RFC 3501 [5.1.3]). This entry will do the // necessary conversion. - // 'value' => Horde_String::convertCharset('Drafts', null, 'UTF7-IMAP') + // 'value' => Horde_String::convertCharset('Drafts', 'UTF-8', 'UTF7-IMAP') ); // trash folder selection widget. @@ -155,7 +155,7 @@ $_prefs['trash_folder'] = array( // If the mailbox value contains non-ASCII characters, it must be encoded // in the UTF7-IMAP charset (RFC 3501 [5.1.3]). This entry will do the // necessary conversion. - // 'value' => Horde_String::convertCharset('Trash', null, 'UTF7-IMAP'), + // 'value' => Horde_String::convertCharset('Trash', 'UTF-8', 'UTF7-IMAP'), // Exchange servers use this default value instead. // 'value' => 'Deleted Items' ); @@ -174,7 +174,7 @@ $_prefs['spam_folder'] = array( // If the mailbox value contains non-ASCII characters, it must be encoded // in the UTF7-IMAP charset (RFC 3501 [5.1.3]). This entry will do the // necessary conversion. - // 'value' => Horde_String::convertCharset('Spam', null, 'UTF7-IMAP') + // 'value' => Horde_String::convertCharset('Spam', 'UTF-8', 'UTF7-IMAP') ); diff --git a/imp/folders.php b/imp/folders.php index fe9deda07..fe0237635 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -30,7 +30,6 @@ if (!$conf['user']['allow_folders']) { $subscribe = $prefs->getValue('subscribe'); $showAll = (!$subscribe || $_SESSION['imp']['showunsub']); -$charset = 'UTF-8'; $vars = Horde_Variables::getDefaultVariables(); /* Get the base URL for this page. */ @@ -131,7 +130,7 @@ case 'import_mbox': if ($vars->import_folder) { try { $browser->wasFileUploaded('mbox_upload', _("mailbox file")); - $res = $imp_folder->importMbox(Horde_String::convertCharset($vars->import_folder, $charset, 'UTF7-IMAP'), $_FILES['mbox_upload']['tmp_name']); + $res = $imp_folder->importMbox(Horde_String::convertCharset($vars->import_folder, 'UTF-8', 'UTF7-IMAP'), $_FILES['mbox_upload']['tmp_name']); $mbox_name = basename(Horde_Util::dispelMagicQuotes($_FILES['mbox_upload']['name'])); if ($res === false) { $notification->push(sprintf(_("There was an error importing %s."), $mbox_name), 'horde.error'); @@ -150,7 +149,7 @@ case 'import_mbox': case 'create_folder': if ($vars->new_mailbox) { try { - $new_mailbox = $imaptree->createMailboxName(array_shift($folder_list), Horde_String::convertCharset($vars->new_mailbox, $charset, 'UTF7-IMAP')); + $new_mailbox = $imaptree->createMailboxName(array_shift($folder_list), Horde_String::convertCharset($vars->new_mailbox, 'UTF-8', 'UTF7-IMAP')); $imp_folder->create($new_mailbox, $subscribe); } catch (Horde_Exception $e) { $notification->push($e); @@ -182,7 +181,7 @@ case 'rename_folder': $new = $old_ns['name'] . $new; } - $imp_folder->rename($old_name, Horde_String::convertCharset($new, $charset, 'UTF7-IMAP')); + $imp_folder->rename($old_name, Horde_String::convertCharset($new, 'UTF-8', 'UTF7-IMAP')); } } break; @@ -343,7 +342,7 @@ if ($_SESSION['imp']['file_upload'] && ($vars->actionID == 'import_mbox')) { $i_template->setOption('gettext', true); $i_template->set('folders_url', $folders_url_ob); $i_template->set('import_folder', $folder_list[0]); - $i_template->set('folder_name', htmlspecialchars(Horde_String::convertCharset($folder_list[0], 'UTF7-IMAP'), ENT_COMPAT, $charset)); + $i_template->set('folder_name', htmlspecialchars(Horde_String::convertCharset($folder_list[0], 'UTF7-IMAP', 'UTF-8'))); $i_template->set('folders_token', $folders_token); echo $i_template->fetch(IMP_TEMPLATES . '/imp/folders/import.html'); require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index b1576517a..c2001c3a4 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -556,23 +556,21 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $mdn->addMdnRequestHeaders($barefrom); } - $browser_charset = 'UTF-8'; - - $headers->addHeader('From', Horde_String::convertCharset($header['from'], $browser_charset, $charset)); + $headers->addHeader('From', Horde_String::convertCharset($header['from'], 'UTF-8', $charset)); if (!empty($header['replyto']) && ($header['replyto'] != $barefrom)) { - $headers->addHeader('Reply-to', Horde_String::convertCharset($header['replyto'], $browser_charset, $charset)); + $headers->addHeader('Reply-to', Horde_String::convertCharset($header['replyto'], 'UTF-8', $charset)); } if (!empty($header['to'])) { - $headers->addHeader('To', Horde_String::convertCharset($header['to'], $browser_charset, $charset)); + $headers->addHeader('To', Horde_String::convertCharset($header['to'], 'UTF-8', $charset)); } elseif (empty($header['to']) && empty($header['cc'])) { $headers->addHeader('To', 'undisclosed-recipients:;'); } if (!empty($header['cc'])) { - $headers->addHeader('Cc', Horde_String::convertCharset($header['cc'], $browser_charset, $charset)); + $headers->addHeader('Cc', Horde_String::convertCharset($header['cc'], 'UTF-8', $charset)); } - $headers->addHeader('Subject', Horde_String::convertCharset($header['subject'], $browser_charset, $charset)); + $headers->addHeader('Subject', Horde_String::convertCharset($header['subject'], 'UTF-8', $charset)); /* Add necessary headers for replies. */ $this->_addReferences($headers); @@ -648,7 +646,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator /* Keep Bcc: headers on saved messages. */ if (!empty($header['bcc'])) { - $headers->addHeader('Bcc', Horde_String::convertCharset($header['bcc'], $browser_charset, $charset)); + $headers->addHeader('Bcc', Horde_String::convertCharset($header['bcc'], 'UTF-8', $charset)); } /* Strip attachments if requested. */ @@ -687,7 +685,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator } try { - $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->append(Horde_String::convertCharset($opts['sent_folder'], 'UTF-8', 'UTF-8'), array(array('data' => $fcc, 'flags' => $flags))); + $GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->append($opts['sent_folder'], array(array('data' => $fcc, 'flags' => $flags))); } catch (Horde_Imap_Client_Exception $e) { $notification->push(sprintf(_("Message sent successfully, but not saved to %s"), IMP::displayFolder($opts['sent_folder']))); $sent_saved = false; @@ -996,7 +994,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator // Convert IDN hosts to ASCII. if (function_exists('idn_to_ascii')) { $old_error = error_reporting(0); - $host = idn_to_ascii(Horde_String::convertCharset($host, 'UTF-8', 'UTF-8')); + $host = idn_to_ascii($host); error_reporting($old_error); } elseif (Horde_Mime::is8bit($ob['mailbox'], 'UTF-8')) { throw new IMP_Compose_Exception(sprintf(_("Invalid character in e-mail address: %s."), $email)); @@ -1033,8 +1031,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator protected function _createMimeMessage($to, $body, $charset, $options = array()) { - $nls_charset = 'UTF-8'; - $body = Horde_String::convertCharset($body, $nls_charset, $charset); + $body = Horde_String::convertCharset($body, 'UTF-8', $charset); if (!empty($options['html'])) { $body_html = $body; @@ -1073,7 +1070,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $htmlBody->setType('text/html'); $htmlBody->setCharset($charset); $htmlBody->setDisposition('inline'); - $htmlBody->setDescription(Horde_String::convertCharset(_("HTML Message"), $nls_charset, $charset)); + $htmlBody->setDescription(Horde_String::convertCharset(_("HTML Message"), 'UTF-8', $charset)); /* Add default font CSS information here. The data comes to us * with no HTML body tag - so simply wrap the data in a body @@ -1094,7 +1091,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $htmlBody->setContents($GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body_html, 'cleanhtml', array('charset' => $charset))); - $textBody->setDescription(Horde_String::convertCharset(_("Plaintext Message"), $nls_charset, $charset)); + $textBody->setDescription(Horde_String::convertCharset(_("Plaintext Message"), 'UTF-8', $charset)); $textpart = new Horde_Mime_Part(); $textpart->setType('multipart/alternative'); @@ -2175,13 +2172,13 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator '/%r/' => $h->getValue('date'), /* Date as ddd, dd mmm yyyy. */ - '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), 'UTF-8'), + '/%d/' => strftime("%a, %d %b %Y", $udate), /* Date in locale's default. */ - '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), 'UTF-8'), + '/%x/' => strftime("%x", $udate), /* Date and time in locale's default. */ - '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), 'UTF-8'), + '/%c/' => strftime("%c", $udate), /* Message-ID. */ '/%m/' => $message_id, @@ -2464,9 +2461,8 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $part = $contents->getMIMEPart($body_id); $type = $part->getType(); $part_charset = $part->getCharset(); - $charset = 'UTF-8'; - $msg = Horde_String::convertCharset($part->getContents(), $part_charset, $charset); + $msg = Horde_String::convertCharset($part->getContents(), $part_charset, 'UTF-8'); /* Enforce reply limits. */ if (!empty($options['replylimit']) && @@ -2478,9 +2474,9 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator } if ($mode == 'html') { - $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, array('Cleanhtml', 'Xss'), array(array('body_only' => true), array('charset' => $charset, 'strip_styles' => true, 'strip_style_attributes' => false))); + $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, array('Cleanhtml', 'Xss'), array(array('body_only' => true), array('strip_styles' => true, 'strip_style_attributes' => false))); } elseif ($type == 'text/html') { - $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, 'Html2text', array('charset' => $charset)); + $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, 'Html2text'); $type = 'text/plain'; } @@ -2513,8 +2509,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator /* Determine default encoding. */ $encoding = $GLOBALS['registry']->getEmailCharset(); - if (($charset == 'UTF-8') && - (strcasecmp($part_charset, 'US-ASCII') !== 0) && + if ((strcasecmp($part_charset, 'US-ASCII') !== 0) && (strcasecmp($part_charset, $encoding) !== 0)) { $encoding = 'UTF-8'; } diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index f6dbffd7b..3c7a7cd85 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -533,12 +533,11 @@ class IMP_Contents // Retrieve 3x the size of $maxlen of bodytext data. This should // account for any content-encoding & HTML tags. $pmime = $this->getMIMEPart($mimeid, array('length' => $maxlen * 3)); - $charset = 'UTF-8'; - $ptext = Horde_String::convertCharset($pmime->getContents(), $pmime->getCharset(), $charset); + $ptext = Horde_String::convertCharset($pmime->getContents(), $pmime->getCharset(), 'UTF-8'); if ($pmime->getType() == 'text/html') { - $ptext = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($ptext, 'Html2text', array('charset' => $charset)); + $ptext = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($ptext, 'Html2text'); } $this->_build = $oldbuild; diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 36280402e..97f54ffff 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -393,7 +393,7 @@ class IMP } } - $cache[$folder] = Horde_String::convertCharset($out, 'UTF7-IMAP'); + $cache[$folder] = Horde_String::convertCharset($out, 'UTF7-IMAP', 'UTF-8'); return $cache[$folder]; } diff --git a/imp/lib/Imap/Flags.php b/imp/lib/Imap/Flags.php index 510417724..c6eacb42e 100644 --- a/imp/lib/Imap/Flags.php +++ b/imp/lib/Imap/Flags.php @@ -117,7 +117,7 @@ class IMP_Imap_Flags foreach ($avail_flags as $key) { if (!isset($this->_flags[$key])) { /* Keywords might be UTF7-IMAP encoded. */ - $ret[$key] = $this->_createEntry(Horde_String::convertCharset($key, 'UTF7-IMAP')); + $ret[$key] = $this->_createEntry(Horde_String::convertCharset($key, 'UTF7-IMAP', 'UTF-8')); $ret[$key]['flag'] = $key; $this->_tempflags[$key] = $ret[$key]; } else { diff --git a/imp/lib/Mime/Viewer/Plain.php b/imp/lib/Mime/Viewer/Plain.php index 1234427c7..e8a64409d 100644 --- a/imp/lib/Mime/Viewer/Plain.php +++ b/imp/lib/Mime/Viewer/Plain.php @@ -78,7 +78,7 @@ class IMP_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain // Convert to the local charset. if ($inline) { - $text = Horde_String::convertCharset($text, $charset, $this->getConfigParam('charset')); + $text = Horde_String::convertCharset($text, $charset, 'UTF-8'); $charset = $this->getConfigParam('charset'); } $type = 'text/html; charset=' . $charset; @@ -274,7 +274,7 @@ class IMP_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain $part2 = new Horde_Mime_Part(); $part2->setType('application/pgp-signature'); - $part2->setContents(Horde_String::convertCharset(implode("\n", $val['data']) . "\n" . implode("\n", $sig['data']), $charset)); + $part2->setContents(Horde_String::convertCharset(implode("\n", $val['data']) . "\n" . implode("\n", $sig['data']), $charset, 'UTF-8')); // A true pgp-signature part would only contain the // detached signature. However, we need to carry around // the entire armored text to verify correctly. Use a @@ -304,7 +304,7 @@ class IMP_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain */ protected function _parseUUencode() { - $text = Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset()); + $text = Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset(), 'UTF-8'); $files = Horde_Mime::uudecode($text); if (empty($files)) { @@ -353,7 +353,7 @@ class IMP_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain ); return '
' . - $this->_textFilter(Horde_String::convertCharset(fread($stream, 1024), $this->_mimepart->getCharset(), $this->getConfigParam('charset')), array_keys($filters), array_values($filters)) . + $this->_textFilter(Horde_String::convertCharset(fread($stream, 1024), $this->_mimepart->getCharset(), 'UTF-8'), array_keys($filters), array_values($filters)) . ' [...]
'; } diff --git a/imp/view.php b/imp/view.php index e62d83b4b..db0b152dc 100644 --- a/imp/view.php +++ b/imp/view.php @@ -41,7 +41,7 @@ function _sanitizeName($name) { - return Horde_String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', Horde_String::convertCharset($name, 'UTF-8', 'UTF-8')), ' _'), 'UTF-8'); + return trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', $name), ' _'); } require_once dirname(__FILE__) . '/lib/Application.php'; diff --git a/ingo/lib/Storage/Filters/Sql.php b/ingo/lib/Storage/Filters/Sql.php index ad54d6e9b..fcbf555bc 100644 --- a/ingo/lib/Storage/Filters/Sql.php +++ b/ingo/lib/Storage/Filters/Sql.php @@ -69,11 +69,11 @@ class Ingo_Storage_Filters_Sql extends Ingo_Storage_Filters { while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) { $data[$row['rule_order']] = array( 'id' => (int)$row['rule_id'], - 'name' => Horde_String::convertCharset($row['rule_name'], $this->_params['charset']), + 'name' => Horde_String::convertCharset($row['rule_name'], $this->_params['charset'], 'UTF-8'), 'action' => (int)$row['rule_action'], - 'action-value' => Horde_String::convertCharset($row['rule_value'], $this->_params['charset']), + 'action-value' => Horde_String::convertCharset($row['rule_value'], $this->_params['charset'], 'UTF-8'), 'flags' => (int)$row['rule_flags'], - 'conditions' => empty($row['rule_conditions']) ? null : Horde_String::convertCharset(unserialize($row['rule_conditions']), $this->_params['charset']), + 'conditions' => empty($row['rule_conditions']) ? null : Horde_String::convertCharset(unserialize($row['rule_conditions']), $this->_params['charset'], 'UTF-8'), 'combine' => (int)$row['rule_combine'], 'stop' => (bool)$row['rule_stop'], 'disable' => !(bool)$row['rule_active']); diff --git a/ingo/lib/Storage/Sql.php b/ingo/lib/Storage/Sql.php index f3c464f42..b3cbc409a 100644 --- a/ingo/lib/Storage/Sql.php +++ b/ingo/lib/Storage/Sql.php @@ -142,8 +142,8 @@ class Ingo_Storage_Sql extends Ingo_Storage $ob->setVacationEnd((int)$data['vacation_end']); $ob->setVacationExcludes(explode("\n", $data['vacation_excludes']), false); $ob->setVacationIgnorelist((bool)$data['vacation_ignorelists']); - $ob->setVacationReason(Horde_String::convertCharset($data['vacation_reason'], $this->_params['charset'])); - $ob->setVacationSubject(Horde_String::convertCharset($data['vacation_subject'], $this->_params['charset'])); + $ob->setVacationReason(Horde_String::convertCharset($data['vacation_reason'], $this->_params['charset'], 'UTF-8')); + $ob->setVacationSubject(Horde_String::convertCharset($data['vacation_subject'], $this->_params['charset'], 'UTF-8')); $ob->setSaved(true); } elseif ($data = @unserialize($GLOBALS['prefs']->getDefault('vacation'))) { $ob->setVacationAddresses($data['addresses'], false); diff --git a/jonah/lib/Driver/Sql.php b/jonah/lib/Driver/Sql.php index bb97d9003..359bd8b3b 100644 --- a/jonah/lib/Driver/Sql.php +++ b/jonah/lib/Driver/Sql.php @@ -119,7 +119,7 @@ class Jonah_Driver_Sql extends Jonah_Driver throw new Jonah_Exception($result); } for ($i = 0; $i < count($result); $i++) { - $result[$i]['channel_name'] = Horde_String::convertCharset($result[$i]['channel_name'], $this->_params['charset']); + $result[$i]['channel_name'] = Horde_String::convertCharset($result[$i]['channel_name'], $this->_params['charset'], 'UTF-8'); } return $result; diff --git a/kronolith/lib/Driver/Sql.php b/kronolith/lib/Driver/Sql.php index 8df6d2d83..c56e58827 100644 --- a/kronolith/lib/Driver/Sql.php +++ b/kronolith/lib/Driver/Sql.php @@ -929,7 +929,7 @@ class Kronolith_Driver_Sql extends Kronolith_Driver */ public function convertFromDriver($value) { - return Horde_String::convertCharset($value, $this->_params['charset']); + return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8'); } /** diff --git a/mnemo/lib/Driver/sql.php b/mnemo/lib/Driver/sql.php index abc009e96..360cdbb1f 100644 --- a/mnemo/lib/Driver/sql.php +++ b/mnemo/lib/Driver/sql.php @@ -373,7 +373,7 @@ class Mnemo_Driver_sql extends Mnemo_Driver { /* Decrypt note if requested. */ $encrypted = false; - $body = Horde_String::convertCharset($row['memo_body'], $this->_params['charset']); + $body = Horde_String::convertCharset($row['memo_body'], $this->_params['charset'], 'UTF-8'); if (strpos($body, '-----BEGIN PGP MESSAGE-----') === 0) { $encrypted = true; if (empty($passphrase)) { @@ -395,10 +395,10 @@ class Mnemo_Driver_sql extends Mnemo_Driver { /* Create a new task based on $row's values. */ return array('memolist_id' => $row['memo_owner'], 'memo_id' => $row['memo_id'], - 'uid' => Horde_String::convertCharset($row['memo_uid'], $this->_params['charset']), - 'desc' => Horde_String::convertCharset($row['memo_desc'], $this->_params['charset']), + 'uid' => Horde_String::convertCharset($row['memo_uid'], $this->_params['charset'], 'UTF-8'), + 'desc' => Horde_String::convertCharset($row['memo_desc'], $this->_params['charset'], 'UTF-8'), 'body' => $body, - 'category' => Horde_String::convertCharset($row['memo_category'], $this->_params['charset']), + 'category' => Horde_String::convertCharset($row['memo_category'], $this->_params['charset'], 'UTF-8'), 'encrypted' => $encrypted); } diff --git a/nag/lib/Driver/Sql.php b/nag/lib/Driver/Sql.php index 18ded455a..155968acd 100644 --- a/nag/lib/Driver/Sql.php +++ b/nag/lib/Driver/Sql.php @@ -451,13 +451,13 @@ class Nag_Driver_Sql extends Nag_Driver { return array( 'tasklist_id' => $row['task_owner'], 'task_id' => $row['task_id'], - 'uid' => Horde_String::convertCharset($row['task_uid'], $this->_params['charset']), + 'uid' => Horde_String::convertCharset($row['task_uid'], $this->_params['charset'], 'UTF-8'), 'parent' => $row['task_parent'], 'owner' => $row['task_creator'], 'assignee' => $row['task_assignee'], - 'name' => Horde_String::convertCharset($row['task_name'], $this->_params['charset']), - 'desc' => Horde_String::convertCharset($row['task_desc'], $this->_params['charset']), - 'category' => Horde_String::convertCharset($row['task_category'], $this->_params['charset']), + 'name' => Horde_String::convertCharset($row['task_name'], $this->_params['charset'], 'UTF-8'), + 'desc' => Horde_String::convertCharset($row['task_desc'], $this->_params['charset'], 'UTF-8'), + 'category' => Horde_String::convertCharset($row['task_category'], $this->_params['charset'], 'UTF-8'), 'start' => $row['task_start'], 'due' => $row['task_due'], 'priority' => $row['task_priority'], @@ -465,7 +465,7 @@ class Nag_Driver_Sql extends Nag_Driver { 'completed' => $row['task_completed'], 'completed_date' => isset($row['task_completed_date']) ? $row['task_completed_date'] : null, 'alarm' => $row['task_alarm'], - 'methods' => Horde_String::convertCharset(@unserialize($row['task_alarm_methods']), $this->_params['charset']), + 'methods' => Horde_String::convertCharset(@unserialize($row['task_alarm_methods']), $this->_params['charset'], 'UTF-8'), 'private' => $row['task_private'] ); } diff --git a/trean/lib/Bookmarks.php b/trean/lib/Bookmarks.php index e705fac7c..a3e9d503c 100644 --- a/trean/lib/Bookmarks.php +++ b/trean/lib/Bookmarks.php @@ -112,7 +112,8 @@ class Trean_Bookmarks 'bookmark_' . $criterion[0], $criterion[1], Horde_String::convertCharset($criterion[2], - $GLOBALS['conf']['sql']['charset']), + $GLOBALS['conf']['sql']['charset'], + 'UTF-8'), true, isset($criterion[3]) ? $criterion[3] : array()); $clauses[] = $clause[0]; @@ -545,7 +546,7 @@ class Trean_Bookmarks foreach ($bookmark as $key => $value) if (!empty($value) && !is_numeric($value)) { $cvBookmarks[$key] = Horde_String::convertCharset( - $value, $GLOBALS['conf']['sql']['charset']); + $value, $GLOBALS['conf']['sql']['charset'], 'UTF-8'); } else { $cvBookmarks[$key] = $value; } diff --git a/turba/lib/Driver/Ldap.php b/turba/lib/Driver/Ldap.php index ec4200572..1601df76b 100644 --- a/turba/lib/Driver/Ldap.php +++ b/turba/lib/Driver/Ldap.php @@ -299,7 +299,7 @@ class Turba_Driver_Ldap extends Turba_Driver $this->_encodeAttributes($attributes); if (!@ldap_add($this->_ds, Horde_String::convertCharset($dn, 'UTF-8', $this->_params['charset']), $attributes)) { - throw new Turba_Exception('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . ']).' . "Charset:UTF-8'); + throw new Turba_Exception('Failed to add an object: [' . ldap_errno($this->_ds) . '] "' . ldap_error($this->_ds) . '" DN: ' . $dn . ' (attributes: [' . serialize($attributes) . '])'); } } @@ -507,7 +507,7 @@ class Turba_Driver_Ldap extends Turba_Driver foreach ($fields as $field) { $field_l = Horde_String::lower($field); if ($field == 'dn') { - $result[$field] = Horde_String::convertCharset($entry[$field_l], $this->_params['charset']); + $result[$field] = Horde_String::convertCharset($entry[$field_l], $this->_params['charset'], 'UTF-8'); } else { $result[$field] = ''; if (!empty($entry[$field_l])) { @@ -515,7 +515,7 @@ class Turba_Driver_Ldap extends Turba_Driver if (!empty($result[$field])) { $result[$field] .= $this->_params['multiple_entry_separator']; } - $result[$field] .= Horde_String::convertCharset($entry[$field_l][$j], $this->_params['charset']); + $result[$field] .= Horde_String::convertCharset($entry[$field_l][$j], $this->_params['charset'], 'UTF-8'); } /* If schema checking is enabled check the diff --git a/turba/lib/Driver/Sql.php b/turba/lib/Driver/Sql.php index 3f63b185a..72bdd15c2 100644 --- a/turba/lib/Driver/Sql.php +++ b/turba/lib/Driver/Sql.php @@ -647,7 +647,7 @@ class Turba_Driver_Sql extends Turba_Driver */ protected function _convertFromDriver($value) { - return Horde_String::convertCharset($value, $this->_params['charset']); + return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8'); } /** diff --git a/whups/lib/Driver/sql.php b/whups/lib/Driver/sql.php index e31d1078c..8896844aa 100644 --- a/whups/lib/Driver/sql.php +++ b/whups/lib/Driver/sql.php @@ -297,7 +297,7 @@ class Whups_Driver_sql extends Whups_Driver { . ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; $values = array($ticketId, Horde_String::convertCharset($summary, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $requester, $type, $state, @@ -1007,7 +1007,7 @@ class Whups_Driver_sql extends Whups_Driver { return array(); } - $info = Horde_String::convertCharset($info, $this->_params['charset']); + $info = Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); $tickets = array(); foreach ($info as $ticket) { @@ -1115,7 +1115,7 @@ class Whups_Driver_sql extends Whups_Driver { return $result; } $guestCache[$guest_id] = Horde_String::convertCharset( - $result, $this->_params['charset']); + $result, $this->_params['charset'], 'UTF-8'); } return $guestCache[$guest_id]; } @@ -1162,7 +1162,7 @@ class Whups_Driver_sql extends Whups_Driver { return $history; } - $history = Horde_String::convertCharset($history, $this->_params['charset']); + $history = Horde_String::convertCharset($history, $this->_params['charset'], 'UTF-8'); for ($i = 0, $iMax = count($history); $i < $iMax; ++$i) { if ($history[$i]['log_type'] == 'queue') { $queue = $this->getQueue($history[$i]['log_value_num']); @@ -1279,7 +1279,7 @@ class Whups_Driver_sql extends Whups_Driver { return $queues; } - return Horde_String::convertCharset($queues, $this->_params['charset']); + return Horde_String::convertCharset($queues, $this->_params['charset'], 'UTF-8'); } function getQueueInternal($queueId) @@ -1305,7 +1305,7 @@ class Whups_Driver_sql extends Whups_Driver { return false; } - $queue = Horde_String::convertCharset($queue, $this->_params['charset']); + $queue = Horde_String::convertCharset($queue, $this->_params['charset'], 'UTF-8'); $queues[$queueId] = array('id' => (int)$queue['queue_id'], 'name' => $queue['queue_name'], 'description' => $queue['queue_description'], @@ -1334,7 +1334,7 @@ class Whups_Driver_sql extends Whups_Driver { return $queue; } - $queue = Horde_String::convertCharset($queue, $this->_params['charset']); + $queue = Horde_String::convertCharset($queue, $this->_params['charset'], 'UTF-8'); $queue = $queue[0]; return array('id' => $queue[0], 'name' => $queue[1], @@ -1362,7 +1362,7 @@ class Whups_Driver_sql extends Whups_Driver { return array(); } - $internals = Horde_String::convertCharset($queues, $this->_params['charset']); + $internals = Horde_String::convertCharset($queues, $this->_params['charset'], 'UTF-8'); return $internals; } @@ -1587,7 +1587,7 @@ class Whups_Driver_sql extends Whups_Driver { return $type; } - $type = Horde_String::convertCharset($type, $this->_params['charset']); + $type = Horde_String::convertCharset($type, $this->_params['charset'], 'UTF-8'); return array('id' => $typeId, 'name' => isset($type[$typeId][0]) ? $type[$typeId][0] : '', 'description' => isset($type[$typeId][1]) ? $type[$typeId][1] : ''); @@ -1609,7 +1609,7 @@ class Whups_Driver_sql extends Whups_Driver { return array(); } - return Horde_String::convertCharset($types, $this->_params['charset']); + return Horde_String::convertCharset($types, $this->_params['charset'], 'UTF-8'); } function getTypeIds($queueId) @@ -1634,7 +1634,7 @@ class Whups_Driver_sql extends Whups_Driver { return array(); } - return Horde_String::convertCharset($types, $this->_params['charset']); + return Horde_String::convertCharset($types, $this->_params['charset'], 'UTF-8'); } function getAllTypeInfo() @@ -1650,7 +1650,7 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } function getTypeName($type) @@ -1667,7 +1667,7 @@ class Whups_Driver_sql extends Whups_Driver { return $name; } - return Horde_String::convertCharset($name, $this->_params['charset']); + return Horde_String::convertCharset($name, $this->_params['charset'], 'UTF-8'); } function updateType($typeId, $name, $description) @@ -1675,9 +1675,9 @@ class Whups_Driver_sql extends Whups_Driver { $query = 'UPDATE whups_types' . ' SET type_name = ?, type_description = ? WHERE type_id = ?'; $values = array(Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $typeId); Horde::logMessage( sprintf('Whups_Driver_sql::updateType(): query="%s"; values="%s"', @@ -1770,7 +1770,7 @@ class Whups_Driver_sql extends Whups_Driver { } } - return Horde_String::convertCharset($states, $this->_params['charset']); + return Horde_String::convertCharset($states, $this->_params['charset'], 'UTF-8'); } function getState($stateId) @@ -1790,7 +1790,7 @@ class Whups_Driver_sql extends Whups_Driver { return $state; } - $state = Horde_String::convertCharset($state, $this->_params['charset']); + $state = Horde_String::convertCharset($state, $this->_params['charset'], 'UTF-8'); return array( 'id' => $stateId, 'name' => isset($state[$stateId][0]) ? $state[$stateId][0] : '', @@ -1815,7 +1815,7 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } function updateState($stateId, $name, $description, $category) @@ -1823,11 +1823,11 @@ class Whups_Driver_sql extends Whups_Driver { $query = 'UPDATE whups_states SET state_name = ?, ' . 'state_description = ?, state_category = ? WHERE state_id = ?'; $values = array(Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($category, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $stateId); Horde::logMessage( sprintf('Whups_Driver_sql::updateState(): query="%s"; values="%s"', @@ -1900,7 +1900,7 @@ class Whups_Driver_sql extends Whups_Driver { return $query; } - return Horde_String::convertCharset($query, $this->_params['charset']); + return Horde_String::convertCharset($query, $this->_params['charset'], 'UTF-8'); } /** @@ -1930,7 +1930,7 @@ class Whups_Driver_sql extends Whups_Driver { serialize($query->query)); } $values = Horde_String::convertCharset($values, 'UTF-8', - $this->_params['charset']); + $this->_params['charset']); Horde::logMessage( sprintf('Whups_Driver_sql::saveQuery(): query="%s"; values="%s"', $q, implode(',', $values)), 'DEBUG'); @@ -1978,7 +1978,7 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } function getPriorities($type = null) @@ -2012,7 +2012,7 @@ class Whups_Driver_sql extends Whups_Driver { } } - return Horde_String::convertCharset($priorities, $this->_params['charset']); + return Horde_String::convertCharset($priorities, $this->_params['charset'], 'UTF-8'); } function getPriority($priorityId) @@ -2032,7 +2032,7 @@ class Whups_Driver_sql extends Whups_Driver { return $priority; } - $priority = Horde_String::convertCharset($priority, $this->_params['charset']); + $priority = Horde_String::convertCharset($priority, $this->_params['charset'], 'UTF-8'); return array('id' => $priorityId, 'name' => isset($priority[$priorityId][0]) ? $priority[$priorityId][0] : '', @@ -2048,9 +2048,9 @@ class Whups_Driver_sql extends Whups_Driver { ' SET priority_name = ?, priority_description = ?' . ' WHERE priority_id = ?'; $values = array(Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $priorityId); Horde::logMessage( sprintf('Whups_Driver_sql::updatePriority(): query="%s"; values="%s"', @@ -2117,7 +2117,7 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } function getVersionInternal($versionId) @@ -2137,7 +2137,7 @@ class Whups_Driver_sql extends Whups_Driver { return $version; } - $version = Horde_String::convertCharset($version, $this->_params['charset']); + $version = Horde_String::convertCharset($version, $this->_params['charset'], 'UTF-8'); return array('id' => $versionId, 'name' => isset($version[$versionId][0]) ? $version[$versionId][0] : '', @@ -2152,9 +2152,9 @@ class Whups_Driver_sql extends Whups_Driver { . 'version_description = ?, version_active = ? ' . 'WHERE version_id = ?'; $values = array(Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($description, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), (int)$active, (int)$versionId); Horde::logMessage( @@ -2195,7 +2195,7 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } /** @@ -2219,7 +2219,7 @@ class Whups_Driver_sql extends Whups_Driver { return $reply; } - return Horde_String::convertCharset($reply, $this->_params['charset']); + return Horde_String::convertCharset($reply, $this->_params['charset'], 'UTF-8'); } /** @@ -2234,9 +2234,9 @@ class Whups_Driver_sql extends Whups_Driver { $query = 'UPDATE whups_replies SET reply_name = ?, ' . 'reply_text = ? WHERE reply_id = ?'; $values = array(Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($text, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $reply); Horde::logMessage( sprintf('Whups_Driver_sql::updateReply(): query="%s"; values="%s"', @@ -2377,13 +2377,13 @@ class Whups_Driver_sql extends Whups_Driver { $values = array($new_id, $type_id, Horde_String::convertCharset($name, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($desc, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $type, serialize( Horde_String::convertCharset($params, 'UTF-8', - $this->_params['charset'])), + $this->_params['charset'])), (int)($required == 'on')); Horde::logMessage( @@ -2406,14 +2406,14 @@ class Whups_Driver_sql extends Whups_Driver { . 'attribute_type = ?, attribute_params = ?, ' . 'attribute_required = ? WHERE attribute_id = ?'; $values = array(Horde_String::convertCharset($newname, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), Horde_String::convertCharset($newdesc, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), $newtype, serialize( Horde_String::convertCharset($newparams, - 'UTF-8', - $this->_params['charset'])), + 'UTF-8', + $this->_params['charset'])), (int)($newrequired == 'on'), $attribute_id); Horde::logMessage( @@ -2459,7 +2459,7 @@ class Whups_Driver_sql extends Whups_Driver { return $attributes; } - return Horde_String::convertCharset($attributes, $this->_params['charset']); + return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8'); } function getAttributeDesc($attribute_id) @@ -2484,14 +2484,14 @@ class Whups_Driver_sql extends Whups_Driver { return array( 'id' => $attribute_id, 'attribute_name' => Horde_String::convertCharset( - $attribute['attribute_name'], $this->_params['charset']), + $attribute['attribute_name'], $this->_params['charset'], 'UTF-8'), 'attribute_description' => Horde_String::convertCharset( - $attribute['attribute_description'], $this->_params['charset']), + $attribute['attribute_description'], $this->_params['charset'], 'UTF-8'), 'attribute_type' => empty($attribute['attribute_type']) ? 'text' : $attribute['attribute_type'], 'attribute_params' => Horde_String::convertCharset( @unserialize($attribute['attribute_params']), - $this->_params['charset']), + $this->_params['charset'], 'UTF-8'), 'attribute_required' => (bool)$attribute['attribute_required']); } @@ -2510,7 +2510,7 @@ class Whups_Driver_sql extends Whups_Driver { return $name; } - return Horde_String::convertCharset($name, $this->_params['charset']); + return Horde_String::convertCharset($name, $this->_params['charset'], 'UTF-8'); } function _getAttributesForType($type = null, $raw = false) @@ -2548,15 +2548,15 @@ class Whups_Driver_sql extends Whups_Driver { . ' (' . $attribute['type_name'] . ')'; } $attributes[$id]['attribute_name'] = Horde_String::convertCharset( - $attribute['attribute_name'], $this->_params['charset']); + $attribute['attribute_name'], $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_description'] = Horde_String::convertCharset( - $attribute['attribute_description'], $this->_params['charset']); + $attribute['attribute_description'], $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_type'] = empty($attribute['attribute_type']) ? 'text' : $attribute['attribute_type']; $attributes[$id]['attribute_params'] = Horde_String::convertCharset( @unserialize($attribute['attribute_params']), - $this->_params['charset']); + $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_required'] = (bool)$attribute['attribute_required']; } @@ -2582,7 +2582,7 @@ class Whups_Driver_sql extends Whups_Driver { return $names; } - return Horde_String::convertCharset($names, $this->_params['charset']); + return Horde_String::convertCharset($names, $this->_params['charset'], 'UTF-8'); } function getAttributeInfoForType($type_id) @@ -2601,14 +2601,14 @@ class Whups_Driver_sql extends Whups_Driver { return $info; } - return Horde_String::convertCharset($info, $this->_params['charset']); + return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8'); } function _setAttributeValue($ticket_id, $attribute_id, $attribute_value) { $db_attribute_value = Horde_String::convertCharset((string)$attribute_value, - 'UTF-8', - $this->_params['charset']); + 'UTF-8', + $this->_params['charset']); $this->_write_db->autoCommit(false); $query = 'DELETE FROM whups_attributes ' @@ -2672,7 +2672,7 @@ class Whups_Driver_sql extends Whups_Driver { return $attributes; } - return Horde_String::convertCharset($attributes, $this->_params['charset']); + return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8'); } function getTicketAttributesWithNames($ticket_id) @@ -2712,7 +2712,7 @@ class Whups_Driver_sql extends Whups_Driver { return $attributes; } - return Horde_String::convertCharset($attributes, $this->_params['charset']); + return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8'); } function _getAllTicketAttributesWithNames($ticket_id) @@ -2738,15 +2738,15 @@ class Whups_Driver_sql extends Whups_Driver { foreach ($attributes as $id => $attribute) { $attributes[$id]['attribute_name'] = Horde_String::convertCharset( - $attribute['attribute_name'], $this->_params['charset']); + $attribute['attribute_name'], $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_description'] = Horde_String::convertCharset( - $attribute['attribute_description'], $this->_params['charset']); + $attribute['attribute_description'], $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_type'] = empty($attribute['attribute_type']) ? 'text' : $attribute['attribute_type']; $attributes[$id]['attribute_params'] = Horde_String::convertCharset( @unserialize($attribute['attribute_params']), - $this->_params['charset']); + $this->_params['charset'], 'UTF-8'); $attributes[$id]['attribute_required'] = (bool)$attribute['attribute_required']; } @@ -2809,7 +2809,7 @@ class Whups_Driver_sql extends Whups_Driver { (string)$user, $type, Horde_String::convertCharset((string)$value, 'UTF-8', - $this->_params['charset']), + $this->_params['charset']), (int)$value); Horde::logMessage( sprintf('Whups_Driver_sql::updateLog(): query="%s"; values="%s"', diff --git a/whups/lib/Mail.php b/whups/lib/Mail.php index 56cc913a4..9d7ce238d 100644 --- a/whups/lib/Mail.php +++ b/whups/lib/Mail.php @@ -76,7 +76,7 @@ class Whups_Mail { $body_id = $message->findBody(); if ($body_id) { $part = $message->getPart($body_id); - $comment .= Horde_String::convertCharset($part->transferDecode(), $part->getCharset()); + $comment .= Horde_String::convertCharset($part->transferDecode(), $part->getCharset(), 'UTF-8'); } else { $comment .= _("[ Could not render body of message. ]"); } diff --git a/wicked/lib/Driver/sql.php b/wicked/lib/Driver/sql.php index b4c2268d2..aefab71a9 100644 --- a/wicked/lib/Driver/sql.php +++ b/wicked/lib/Driver/sql.php @@ -838,7 +838,7 @@ class Wicked_Driver_sql extends Wicked_Driver { */ function _convertFromDriver($value) { - return Horde_String::convertCharset($value, $this->getCharset()); + return Horde_String::convertCharset($value, $this->getCharset(), 'UTF-8'); } /**