*/
public function convertFromDriver($value)
{
- return Horde_String::convertCharset($value, $this->_params['charset']);
+ return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8');
}
/**
$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'];
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 {
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];
$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']];
}
}
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();
'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']);
'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']);
}
*/
protected function _fromDriver($value)
{
- return Horde_String::convertCharset($value, $this->_params['charset']);
+ return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8');
}
/**
$ptr = $ptr[$ctx[$i]];
}
- if (is_string($ptr)) {
- $ptr = Horde_String::convertCharset($ptr, 'iso-8859-1');
- }
-
return array($ptr, false);
}
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();
'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);
$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));
}
}
$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];
/* 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]))
'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;
}
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');
}
}
$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;
$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.
*/
function decodeImapFolderName($name)
{
- return Horde_String::convertCharset($name, 'UTF7-IMAP');
+ return Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
}
/**
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)) {
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'
);
}
$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'
);
}
*/
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')
return $this->_renderReturn(
$data,
- 'text/html; charset=' . $this->getConfigParam('charset')
+ 'text/html; charset=UTF-8'
);
}
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'
);
}
* '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
*/
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.');
}
{
return is_bool($value)
? $value
- : Horde_String::convertCharset($value, $this->getCharset(), $this->_opts['uicharset']);
+ : Horde_String::convertCharset($value, $this->getCharset(), 'UTF-8');
}
/**
{
return is_bool($value)
? $value
- : Horde_String::convertCharset($value, $this->_opts['uicharset'], $this->getCharset());
+ : Horde_String::convertCharset($value, 'UTF-8', $this->getCharset());
}
/**
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':
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');
}
}
* <pre>
* 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
* </pre>
* 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.
* </pre>
*
*
* @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;
$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')) {
$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(
if ($first) {
echo '<tr>';
foreach ($row as $key => $val) {
- echo '<th align="left">' . (!strlen($key) ? ' ' : htmlspecialchars(Horde_String::convertCharset($key, $conf['sql']['charset']))) . '</th>';
+ echo '<th align="left">' . (!strlen($key) ? ' ' : htmlspecialchars(Horde_String::convertCharset($key, $conf['sql']['charset'], 'UTF-8'))) . '</th>';
}
echo '</tr>';
$first = false;
}
echo '<tr>';
foreach ($row as $val) {
- echo '<td class="fixed">' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset']))) . '</td>';
+ echo '<td class="fixed">' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset'], 'UTF-8'))) . '</td>';
}
echo '</tr>';
}
echo '<tr><th align="left">' . (isset($description) ? htmlspecialchars($description) : ' ') . '</th></tr>';
$first = false;
}
- echo '<tr><td class="fixed">' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset']))) . '</td></tr>';
+ echo '<tr><td class="fixed">' . (!strlen($val) ? ' ' : htmlspecialchars(Horde_String::convertCharset($val, $conf['sql']['charset'], 'UTF-8'))) . '</td></tr>';
}
echo '</table>';
} else {
// public function pre_sent($message, $headers)
// {
// // Example: Add custom headers to outgoing message.
-// $charset = 'UTF-8';
// $custom_hdrs = array();
// $hdr_charset = $message->getHeaderCharset();
//
// $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));
// }
// }
// 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'
);
// 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.
// 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'
);
// 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')
);
$subscribe = $prefs->getValue('subscribe');
$showAll = (!$subscribe || $_SESSION['imp']['showunsub']);
-$charset = 'UTF-8';
$vars = Horde_Variables::getDefaultVariables();
/* Get the base URL for this page. */
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');
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);
$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;
$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';
$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);
/* 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. */
}
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;
// 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));
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;
$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
$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');
'/%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,
$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']) &&
}
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';
}
/* 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';
}
// 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;
}
}
- $cache[$folder] = Horde_String::convertCharset($out, 'UTF7-IMAP');
+ $cache[$folder] = Horde_String::convertCharset($out, 'UTF7-IMAP', 'UTF-8');
return $cache[$folder];
}
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 {
// 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;
$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
*/
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)) {
);
return '<div class="fixed">' .
- $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)) .
' [...]</div>';
}
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';
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']);
$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);
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;
*/
public function convertFromDriver($value)
{
- return Horde_String::convertCharset($value, $this->_params['charset']);
+ return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8');
}
/**
/* 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)) {
/* 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);
}
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'],
'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']
);
}
'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];
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;
}
$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) . '])');
}
}
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])) {
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
*/
protected function _convertFromDriver($value)
{
- return Horde_String::convertCharset($value, $this->_params['charset']);
+ return Horde_String::convertCharset($value, $this->_params['charset'], 'UTF-8');
}
/**
. ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
$values = array($ticketId,
Horde_String::convertCharset($summary, 'UTF-8',
- $this->_params['charset']),
+ $this->_params['charset']),
$requester,
$type,
$state,
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) {
return $result;
}
$guestCache[$guest_id] = Horde_String::convertCharset(
- $result, $this->_params['charset']);
+ $result, $this->_params['charset'], 'UTF-8');
}
return $guestCache[$guest_id];
}
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']);
return $queues;
}
- return Horde_String::convertCharset($queues, $this->_params['charset']);
+ return Horde_String::convertCharset($queues, $this->_params['charset'], 'UTF-8');
}
function getQueueInternal($queueId)
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'],
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],
return array();
}
- $internals = Horde_String::convertCharset($queues, $this->_params['charset']);
+ $internals = Horde_String::convertCharset($queues, $this->_params['charset'], 'UTF-8');
return $internals;
}
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] : '');
return array();
}
- return Horde_String::convertCharset($types, $this->_params['charset']);
+ return Horde_String::convertCharset($types, $this->_params['charset'], 'UTF-8');
}
function getTypeIds($queueId)
return array();
}
- return Horde_String::convertCharset($types, $this->_params['charset']);
+ return Horde_String::convertCharset($types, $this->_params['charset'], 'UTF-8');
}
function getAllTypeInfo()
return $info;
}
- return Horde_String::convertCharset($info, $this->_params['charset']);
+ return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8');
}
function getTypeName($type)
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)
$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"',
}
}
- return Horde_String::convertCharset($states, $this->_params['charset']);
+ return Horde_String::convertCharset($states, $this->_params['charset'], 'UTF-8');
}
function getState($stateId)
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] : '',
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)
$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"',
return $query;
}
- return Horde_String::convertCharset($query, $this->_params['charset']);
+ return Horde_String::convertCharset($query, $this->_params['charset'], 'UTF-8');
}
/**
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');
return $info;
}
- return Horde_String::convertCharset($info, $this->_params['charset']);
+ return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8');
}
function getPriorities($type = null)
}
}
- return Horde_String::convertCharset($priorities, $this->_params['charset']);
+ return Horde_String::convertCharset($priorities, $this->_params['charset'], 'UTF-8');
}
function getPriority($priorityId)
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] : '',
' 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"',
return $info;
}
- return Horde_String::convertCharset($info, $this->_params['charset']);
+ return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8');
}
function getVersionInternal($versionId)
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] : '',
. '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(
return $info;
}
- return Horde_String::convertCharset($info, $this->_params['charset']);
+ return Horde_String::convertCharset($info, $this->_params['charset'], 'UTF-8');
}
/**
return $reply;
}
- return Horde_String::convertCharset($reply, $this->_params['charset']);
+ return Horde_String::convertCharset($reply, $this->_params['charset'], 'UTF-8');
}
/**
$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"',
$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(
. '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(
return $attributes;
}
- return Horde_String::convertCharset($attributes, $this->_params['charset']);
+ return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8');
}
function getAttributeDesc($attribute_id)
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']);
}
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)
. ' (' . $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'];
}
return $names;
}
- return Horde_String::convertCharset($names, $this->_params['charset']);
+ return Horde_String::convertCharset($names, $this->_params['charset'], 'UTF-8');
}
function getAttributeInfoForType($type_id)
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 '
return $attributes;
}
- return Horde_String::convertCharset($attributes, $this->_params['charset']);
+ return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8');
}
function getTicketAttributesWithNames($ticket_id)
return $attributes;
}
- return Horde_String::convertCharset($attributes, $this->_params['charset']);
+ return Horde_String::convertCharset($attributes, $this->_params['charset'], 'UTF-8');
}
function _getAllTicketAttributesWithNames($ticket_id)
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'];
}
(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"',
$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. ]");
}
*/
function _convertFromDriver($value)
{
- return Horde_String::convertCharset($value, $this->getCharset());
+ return Horde_String::convertCharset($value, $this->getCharset(), 'UTF-8');
}
/**