All data passed around in Horde internally should be UTF-8.
authorJan Schneider <jan@horde.org>
Sun, 3 Oct 2010 16:46:17 +0000 (18:46 +0200)
committerJan Schneider <jan@horde.org>
Sun, 3 Oct 2010 16:53:12 +0000 (18:53 +0200)
205 files changed:
agora/lib/Messages.php
agora/rss/index.php
agora/rss/messages.php
agora/rss/threads.php
agora/templates/common-header.inc
ansel/gallery/sort.php
ansel/img/ecard.php
ansel/lib/Ansel.php
ansel/lib/Block/gallery.php
ansel/lib/Block/my_galleries.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recent_faces.php
ansel/lib/Block/recently_added.php
ansel/lib/GalleryMode/Date.php
ansel/lib/Image.php
ansel/lib/Storage.php
ansel/lib/Tile/DateGallery.php
ansel/lib/Tile/Gallery.php
ansel/lib/View/Base.php
ansel/lib/Widget/Links.php
ansel/rss.php
ansel/templates/captions/captions.inc
ansel/templates/common-header.inc
ansel/templates/faces/gallery.inc
ansel/templates/image/crop_image.inc
ansel/templates/image/edit_image.inc
ansel/templates/image/preview_cropimage.inc
ansel/templates/image/preview_image.inc
ansel/templates/image/resize_image.inc
ansel/templates/list/header.inc
ansel/templates/view/results.inc
ansel/templates/xppublish/new.inc
babel/templates/common-header.inc
chora/templates/common-header.inc
crumb/templates/common-header.inc
drag_n_drop_portal/block.php
drag_n_drop_portal/lib/Block/Layout/View/js.php
fima/postings.php
fima/templates/common-header.inc
folks/templates/common-header.inc
folks/templates/feed/activities.php
folks/templates/feed/feed.php
framework/Alarm/lib/Horde/Alarm/Handler/Mail.php
framework/Alarm/test/Horde/Alarm/SqlTest.php
framework/Block/lib/Horde/Block/Layout/Manager.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php
framework/Core/lib/Horde/Core/Auth/Signup/Base.php
framework/Core/lib/Horde/Core/Factory/Alarm.php
framework/Core/lib/Horde/Core/Factory/Crypt.php
framework/Core/lib/Horde/Core/Factory/TextFilter.php
framework/Core/lib/Horde/Core/Prefs/Identity.php
framework/Core/lib/Horde/Core/Prefs/Ui.php
framework/Core/lib/Horde/Core/Tree/Javascript.php
framework/Core/lib/Horde/Core/Ui/VarRenderer.php
framework/Core/lib/Horde/Registry.php
framework/Crypt/lib/Horde/Crypt.php
framework/Crypt/lib/Horde/Crypt/Pgp.php
framework/Crypt/lib/Horde/Crypt/Smime.php
framework/DataTree/DataTree/sql.php
framework/Date/test/Horde/Date/RecurrenceTest.php
framework/Form/Form/Renderer.php
framework/Group/lib/Horde/Group/Kolab.php
framework/Group/lib/Horde/Group/Ldap.php
framework/Icalendar/lib/Horde/Icalendar.php
framework/Icalendar/test/Horde/Icalendar/charset1.phpt
framework/Itip/lib/Horde/Itip/Response.php
framework/Kolab/Kolab.php
framework/Kolab_Filter/lib/Horde/Kolab/Filter/Configuration.php
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
framework/Kolab_Resource/lib/Horde/Kolab/Resource.php
framework/Kolab_Resource/lib/Horde/Kolab/Resource/Freebusy/Kolab.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Namespace.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Base.php
framework/Ldap/test/Horde/Ldap/LdapTest.php
framework/Ldap/test/Horde/Ldap/SearchTest.php
framework/Mime/lib/Horde/Mime/Address.php
framework/Mime/lib/Horde/Mime/Mail.php
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Syntaxhighlighter.php
framework/Model/lib/Horde/Form/Renderer/Xhtml.php
framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php
framework/Release/lib/Horde/Release.php
framework/Rpc/lib/Horde/Rpc/Webdav.php
framework/Serialize/lib/Horde/Serialize.php
framework/SpellChecker/lib/Horde/SpellChecker.php
framework/SpellChecker/lib/Horde/SpellChecker/Aspell.php
framework/Text_Filter/lib/Horde/Text/Filter/Cleanhtml.php
framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php
framework/Text_Filter/lib/Horde/Text/Filter/Space2html.php
framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php
framework/Text_Filter/lib/Horde/Text/Filter/Xss.php
framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php
framework/Util/lib/Horde/String.php
framework/Util/test/Horde/Util/StringTest.php
framework/View/lib/Horde/View/Helper/Form/InstanceTag/Form.php
gollem/templates/common-header.inc
gollem/templates/javascript_defs.php
hermes/start.php
hermes/templates/common-header.inc
horde/admin/config/config.php
horde/admin/config/scripts.php
horde/config/hooks.php.dist
horde/config/nls.php
horde/docs/CHANGES
horde/docs/INSTALL
horde/lib/Block/twitter_timeline.php
horde/lib/Test.php
horde/services/portal/index.php
horde/services/sidebar.php
horde/services/twitter.php
horde/templates/admin/groups/edit.inc
horde/templates/common-header.inc
hylax/templates/common-header.inc
imp/lib/Mime/Viewer/Itip.php
imp/templates/common-header.inc
ingo/filters.php
ingo/lib/Ingo.php
ingo/lib/Script.php
ingo/lib/Script/Sieve.php
ingo/lib/Storage/Sql.php
ingo/lib/tests/MaildropTest.php
ingo/lib/tests/ProcmailTest.php
ingo/lib/tests/ScriptTest.php
ingo/lib/tests/SieveTest.php
ingo/rule.php
ingo/templates/common-header.inc
ingo/templates/rule/header.inc
jeta/templates/common-header.inc
jonah/delivery/rss.php
jonah/lib/Block/latest.php
jonah/lib/Block/news.php
jonah/lib/Block/news_popular.php
jonah/lib/Block/story.php
jonah/templates/common-header.inc
kastalia/templates/common-header.inc
koward/lib/Koward/View/shared/_header.html.php
koward/www/horde/config/nls.php.dist
koward/www/htdocs/koward/themes/kolab/screen.css
kronolith/add.php
kronolith/data.php
kronolith/edit.php
kronolith/feed/index.php
kronolith/lib/Ajax/Application.php
kronolith/lib/Api.php
kronolith/lib/Application.php
kronolith/lib/Event.php
kronolith/lib/Event/Holidays.php
kronolith/lib/FreeBusy.php
kronolith/lib/Kronolith.php
kronolith/lib/View/ExportEvent.php
kronolith/new.php
kronolith/templates/common-header.inc
kronolith/templates/javascript_defs.php
kronolith/templates/view/view.inc
luxor/templates/common-header.inc
mnemo/data.php
mnemo/memo.php
mnemo/templates/common-header.inc
nag/data.php
nag/lib/Api.php
nag/lib/Forms/task.php
nag/lib/Nag.php
nag/lib/Task.php
nag/task.php
nag/templates/common-header.inc
nag/templates/view/task.inc
news/pdf.php
news/rss/comments.php
news/rss/index.php
news/rss/news.php
news/templates/common-header.inc
operator/templates/common-header.inc
pastie/templates/common-header.inc
shout/templates/common-header.inc
shout/templates/dialplan/edit.inc
skeleton/templates/common-header.inc
skoli/templates/common-header.inc
trean/add.php
trean/data.php
trean/rss.php
trean/templates/common-header.inc
turba/add.php
turba/data.php
turba/lib/Driver.php
turba/lib/Driver/Ldap.php
turba/lib/Object.php
turba/lib/View/Browse.php
turba/templates/common-header.inc
turba/vcard.php
vilma/templates/common-header.inc
whups/lib/Driver/sql.php
whups/lib/Ticket.php
whups/opensearch.php
whups/query/rss.php
whups/queue/rss.php
whups/search/rss.php
whups/templates/common-header.inc
whups/ticket/rss.php
wicked/lib/Page/MergeOrRename.php
wicked/lib/Text_Wiki/Render/Xhtml/Code2.php
wicked/opensearch.php
wicked/templates/common-header.inc
wicked/templates/edit/new.inc
wicked/templates/edit/standard.inc
wicked/templates/history/summary.inc

index d450a80..fb9e436 100644 (file)
@@ -566,7 +566,7 @@ class Agora_Messages {
                                    strftime($GLOBALS['prefs']->getValue('date_format'), $message['message_timestamp']))
             . "\n-------------------------------------------------------\n"
             . $message['body'];
-        $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> ", 'UTF-8');
+        $message['body'] = "\n> " . Horde_String::wrap($message['body'], 60, "\n> ");
 
         return $message;
     }
@@ -993,7 +993,7 @@ class Agora_Messages {
         foreach ($messages as $id => &$message) {
             $message['message_id'] = $id;
             $message['message_author'] = htmlspecialchars($message['message_author']);
-            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, 'UTF-8');
+            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']));
             $message['message_date'] = $this->dateFormat($message['message_timestamp']);
             if ($format) {
                 $message['body'] = $this->formatBody($this->convertFromDriver($message['body']));
@@ -1147,7 +1147,7 @@ class Agora_Messages {
             $message['forum_name'] = $this->convertFromDriver($forums_list[$message['forum_id']]);
             $message['message_id'] = $id;
             $message['message_author'] = htmlspecialchars($message['message_author']);
-            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, 'UTF-8');
+            $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']));
             $message['message_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')filter($this->convertFromDriver($message['body']), 'highlightquotes');
             if ($message['attachments']) {
                 $message['message_attachment'] = $this->getAttachmentLink($id);
index 441ac1a..c582738 100644 (file)
@@ -24,7 +24,7 @@ if (!$rss) {
     $forums = Agora_Messages::singleton($scope);
     $forums_list = $forums->getForums(0, true, 'forum_name', 0);
 
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
@@ -50,5 +50,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
 echo $rss;
index a643241..c0b8fa7 100644 (file)
@@ -31,7 +31,7 @@ if (!$rss) {
         exit;
     }
 
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($message['message_subject']) . '</title>
@@ -59,5 +59,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
 echo $rss;
index 5e9b37a..bd9120c 100644 (file)
@@ -59,7 +59,7 @@ if (!$rss) {
 
     $threads_list = $threads->getThreads(0, false, 'message_modifystamp', 1, true, '', null, 0, 10);
 
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
@@ -98,5 +98,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
 echo $rss;
index d8a3bc7..107e07f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 2a5c600..b941e34 100644 (file)
@@ -69,7 +69,7 @@ require ANSEL_TEMPLATES . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 ?>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <div class="instructions">
  <form action="sort.php" method="post">
   <?php echo Horde_Util::formInput() ?>
@@ -91,7 +91,7 @@ $notification->notify(array('listeners' => 'status'));
 <?php
 $images = $gallery->getImages();
 foreach ($images as $image) {
-    $caption = empty($image->caption) ? htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8') : htmlspecialchars($image->caption, ENT_COMPAT, 'UTF-8');
+    $caption = htmlspecialchars(empty($image->caption) ? $image->filename : $image->caption);
     echo '<div id="o_' . (int)$image->id . '"><a title="'
         . $caption . '" href="#">'
         . '<img src="' . Ansel::getImageUrl($image->id, 'thumb', false, $style) . '" alt="' . htmlspecialchars($image->filename) . '" />'
index d0ec980..01bbf3a 100644 (file)
@@ -35,12 +35,10 @@ case 'send':
         break;
     }
 
-    $charset = 'UTF-8';
-
     /* Create the text part. */
     $textpart = new Horde_Mime_Part();
     $textpart->setType('text/plain');
-    $textpart->setCharset($charset);
+    $textpart->setCharset('UTF-8');
     $textpart->setContents(_("You have been sent an Ecard. To view the Ecard, you must be able to view text/html messages in your mail reader. If you are viewing this message, then most likely your mail reader does not support viewing text/html messages."));
 
     /* Create the multipart/related part. */
@@ -50,7 +48,7 @@ case 'send':
     /* Create the HTML part. */
     $htmlpart = new Horde_Mime_Part();
     $htmlpart->setType('text/html');
-    $htmlpart->setCharset($charset);
+    $htmlpart->setCharset('UTF-8');
 
     /* The image part */
     $imgpart = new Horde_Mime_Part();
@@ -73,7 +71,7 @@ case 'send':
     $alternative->addPart($related);
 
     /* Add them to the mail message */
-    $alt = new Horde_Mime_Mail(array('subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'to' => $to, 'from' => $from, 'charset' => $charset));
+    $alt = new Horde_Mime_Mail(array('subject' => _("Ecard - ") . Horde_Util::getFormData('image_desc'), 'to' => $to, 'from' => $from, 'charset' => 'UTF-8'));
     $alt->setBasePart($alternative);
 
     /* Send. */
index b8a27a7..dae0b17 100644 (file)
@@ -610,7 +610,7 @@ class Ansel
 
         // Check for an active image
         if (!empty($image_id)) {
-            $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8') . '</span>';
+            $text = '<span class="thiscrumb" id="PhotoName">' . htmlspecialchars($image->filename) . '</span>';
             $nav = $separator . $text . $nav;
             $levels++;
         }
@@ -635,7 +635,7 @@ class Ansel
         }
 
         if (!empty($owner_title)) {
-            $owner_title = htmlspecialchars($owner_title, ENT_COMPAT, 'UTF-8');
+            $owner_title = htmlspecialchars($owner_title);
             $levels++;
             if ($gallery) {
                 $nav = $separator . Ansel::getUrlFor('view', array('view' => 'List', 'groupby' => 'owner', 'owner' => $owner, 'havesearch' => $haveSearch))->link() . $owner_title . '</a>' . $nav;
index 73e7209..be2bb44 100644 (file)
@@ -84,9 +84,7 @@ class Horde_Block_ansel_gallery extends Horde_Block
                   'slug' => $gallery->get('slug')),
             true);
 
-        return $viewurl->link()
-               . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8')
-               . '</a>';
+        return $viewurl->link() . htmlspecialchars($name) . '</a>';
     }
 
     /**
index 62985af..42ececa 100644 (file)
@@ -98,7 +98,7 @@ HEADER;
             $html .= '<tr><td>'
                 . $url->link(array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
                                    'onmouseover' => 'previewImageMg(event, ' . $gallery->getKeyImage(Ansel::getStyleDefinition('ansel_default')) . ');'))
-                . @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8') . '</a></td><td>'
+                . htmlspecialchars($gallery->get('name')) . '</a></td><td>'
                 . strftime($GLOBALS['prefs']->getValue('date_format'), $gallery->get('last_modified'))
                 . '</td><td>' . (int)$gallery->countImages(true) . '</td></tr>';
         }
index 301f3ed..8f6b7fd 100644 (file)
@@ -64,7 +64,7 @@ class Horde_Block_ansel_recent_comments extends Horde_Block
             }
             // Build the gallery name.
             if (isset($this->_params['gallery'])) {
-                $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8');
+                $name = htmlspecialchars($gallery->get('name'));
             }
             $viewurl = Ansel::getUrlFor('view',
                                         array('gallery' => $gallery->id,
index c400aa8..3621506 100644 (file)
@@ -52,7 +52,7 @@ class Horde_Block_ansel_recent_faces extends Horde_Block
         $results = $faces->allFaces(0, $this->_params['limit']);
         $html = '';
         foreach ($results as $face_id => $face) {
-            $facename = htmlspecialchars($face['face_name'], ENT_COMPAT, 'UTF-8');
+            $facename = htmlspecialchars($face['face_name']);
             $html .= '<a href="' . Ansel_Faces::getLink($face) . '" title="' . $facename . '">'
                     . '<img src="' . $faces->getFaceUrl($face['image_id'], $face_id)
                     . '" style="padding-bottom: 5px; padding-left: 5px" alt="' . $facename  . '" /></a>';
index 793daf1..b2bae65 100644 (file)
@@ -68,7 +68,7 @@ class Horde_Block_ansel_recently_added extends Horde_Block
                 return Ansel::getUrlFor('view', array('view' => 'List'), true)->link() . _("Gallery") . '</a>';
             }
 
-            $name = @htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8');
+            $name = htmlspecialchars($gallery->get('name'));
             $style = $gallery->getStyle();
             $viewurl = Ansel::getUrlFor('view',
                                         array('slug' => $gallery->get('slug'),
@@ -144,8 +144,7 @@ HEADER;
                               'view' => 'Gallery'),
                 true);
             $galleryLink = $galleryLink->link()
-                . @htmlspecialchars($gallery->get('name'), ENT_COMPAT,
-                                    'UTF-8')
+                . htmlspecialchars($gallery->get('name'))
                 . '</a>';
 
             $caption = substr($image->caption, 0, 30);
@@ -166,9 +165,7 @@ HEADER;
                 . $url->link(
                     array('onmouseout' => '$("ansel_preview").hide();$("ansel_preview").update("");',
                           'onmouseover' => 'previewImage(event, ' . $image->id . ');'))
-                . @htmlspecialchars(
-                    strlen($caption) ? $caption : $image->filename,
-                    ENT_COMPAT, 'UTF-8')
+                . htmlspecialchars(strlen($caption) ? $caption : $image->filename)
                 . '</a></td><td class="nowrap">' . $galleryLink . '</td></tr>';
         }
         $html .= '</tbody></table>';
index 54bd0a2..1c732d8 100644 (file)
@@ -111,7 +111,7 @@ class Ansel_GalleryMode_Date extends Ansel_GalleryMode_Base
             $trail[] = array('title' => _("All dates"), 'navdata' => $navdata);
         }
 
-        $text = htmlspecialchars($this->_gallery->get('name'), ENT_COMPAT, 'UTF-8');
+        $text = htmlspecialchars($this->_gallery->get('name'));
         $navdata = array('view' => 'Gallery',
                          'gallery' => $this->_gallery->id,
                          'slug' => $this->_gallery->get('slug'));
index 5684c55..f97d502 100644 (file)
@@ -1206,7 +1206,7 @@ class Ansel_Image Implements Iterator
                 $output[$field] = $value;
             } else {
                 $description = isset($data['description']) ? $data['description'] : $field;
-                $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</td>';
+                $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value) . '</td>';
             }
         }
 
index 442203f..1488751 100644 (file)
@@ -899,7 +899,7 @@ class Ansel_Storage
 
             if ($galleries[$gallery_id]['perm']) {
                 $data = array((string)Ansel::getImageUrl($image->id, $image_view, $full, $style),
-                    htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8'),
+                    htmlspecialchars($image->filename),
                     $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                     $image->id,
                     0);
@@ -925,10 +925,10 @@ class Ansel_Storage
         }
 
         if (count($json)) {
-            return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8');
-        } else {
-            return '';
+            return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
         }
+
+        return '';
     }
 
     /**
index 8873b59..be60f1d 100644 (file)
@@ -104,7 +104,7 @@ class Ansel_Tile_DateGallery
 
         /* Variables used in the template file */
         $image_link = $view_link . $gallery_image . '</a>';
-        $text_link = $view_link . htmlspecialchars($caption, ENT_COMPAT, 'UTF-8') . '</a>';
+        $text_link = $view_link . htmlspecialchars($caption) . '</a>';
         $gallery_count = $dgallery->countImages(true);
 
         /* Background color is needed if displaying a mini tile */
index 4e5217d..333d4f1 100644 (file)
@@ -77,7 +77,7 @@ class Ansel_Tile_Gallery
         }
 
         $image_link = $view_link . $gallery_image . '</a>';
-        $text_link = $view_link . htmlspecialchars($gallery->get('name'), ENT_COMPAT, 'UTF-8')
+        $text_link = $view_link . htmlspecialchars($gallery->get('name'))
                      . '</a>';
 
         if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT) && !$mini) {
@@ -101,7 +101,7 @@ class Ansel_Tile_Gallery
             if (empty($owner_string)) {
                 $owner_string = $gallery->get('owner');
             }
-            $owner_link .= htmlspecialchars($owner_string, ENT_COMPAT, 'UTF-8') . '</a>';
+            $owner_link .= htmlspecialchars($owner_string) . '</a>';
         }
 
         $gallery_count = $gallery->countImages(true);
index edb21eb..85dc533 100644 (file)
@@ -264,7 +264,7 @@ abstract class Ansel_View_Base
             }
 
             $data = array((string)Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style),
-                          htmlspecialchars($image->filename, ENT_COMPAT, 'UTF-8'),
+                          htmlspecialchars($image->filename),
                           $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                           $image->id,
                           $curpage);
@@ -286,7 +286,7 @@ abstract class Ansel_View_Base
             $json[] = $data;
         }
 
-        return Horde_Serialize::serialize($json, Horde_Serialize::JSON, 'UTF-8');
+        return Horde_Serialize::serialize($json, Horde_Serialize::JSON);
     }
 
     /**
index 167a278..bcdd488 100644 (file)
@@ -24,7 +24,7 @@ class Ansel_Widget_Links extends Ansel_Widget_Base
         $html = $this->_htmlBegin();
         $html .= Ansel::getUrlFor('rss_user', array('owner' => $owner))->link() . Horde::img('feed.png') . ' ' . ($owner ? sprintf(_("Recent photos by %s"), $owner) : _("Recent system photos")) . '</a>';
         $slug = $this->_view->gallery->get('slug');
-        $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'), ENT_COMPAT, 'UTF-8')) . '</a>';
+        $html .= '<br />' . Ansel::getUrlFor('rss_gallery', array('gallery' => $this->_view->gallery->id, 'slug' => $slug))->link() . ' ' .  Horde::img('feed.png') . ' ' . sprintf(_("Recent photos in %s"), htmlspecialchars($this->_view->gallery->get('name'))) . '</a>';
 
         /* Embed html */
         if (empty($this->_view->_params['image_id'])) {
index 70f18e9..573976a 100644 (file)
@@ -263,10 +263,9 @@ if (empty($rss)) {
         }
     }
 
-    $charset = 'UTF-8';
     $xsl = $registry->get('themesuri') . '/feed-rss.xsl';
-    $stream_name = @htmlspecialchars($params['name'], ENT_COMPAT, 'UTF-8');
-    $stream_desc = @htmlspecialchars($params['desc'], ENT_COMPAT, 'UTF-8');
+    $stream_name = htmlspecialchars($params['name']);
+    $stream_desc = htmlspecialchars($params['desc']);
     $stream_updated = htmlspecialchars(date('r', $params['last_modified']));
     $stream_official = htmlspecialchars($params['link']);
     $image_url = htmlspecialchars($params['image_url']);
index 39f2755..3aa7c6b 100644 (file)
@@ -7,7 +7,7 @@
 <input type="hidden" name="day" value="<?php echo (empty($date['day']) ? 0 : $date['day']) ?>" />
 
 <h1 class="header">
- <?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?>
+ <?php echo htmlspecialchars($title) ?>
 </h1>
 
 <?php if ($gallery->get('desc')): ?>
@@ -33,7 +33,7 @@ if ($gallery->countImages()) {
         echo '<td width="10%" align="right" valign="top">';
         echo '<img src="' . $thumb_url . '" alt="' . htmlspecialchars($image->filename) . '" />' .
             '</td><td width="40%" valign="top"><textarea name="img' . $image->id . '" rows="5" cols="25">' .
-            htmlspecialchars($image->caption, ENT_COMPAT, 'UTF-8') . '</textarea></td>';
+            htmlspecialchars($image->caption) . '</textarea></td>';
 
         $count++;
         if (($count % 2) == 0) {
index 72c02d3..2118911 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
@@ -21,7 +21,7 @@ Horde::outputMetaTags();
 Horde::includeScriptFiles();
 
 ?>
-<title><?php echo htmlspecialchars($page_title, ENT_COMPAT, 'UTF-8') ?></title>
+<title><?php echo htmlspecialchars($page_title) ?></title>
 <link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
 <?php echo Ansel::stylesheetLinks() ?>
 <?php echo Horde::wrapInlineScript(Ansel::initJSVars());?>
index 12a6c14..f73040a 100644 (file)
@@ -32,7 +32,7 @@
 <?php echo $pager->render() ?>
 <script type="text/javascript">
 //<![CDATA[
-var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON, 'UTF-8'); ?>;
+var imgids = <?php echo Horde_Serialize::serialize($imageids, Horde_Serialize::JSON); ?>;
 
 function proccessImageFaces(image_id, reget) {
     var url = '<?php echo Horde::url('faces/image.php'); ?>';
index 44957f5..49de834 100644 (file)
@@ -83,7 +83,7 @@ function changeRatio()
 }
 </script>
 
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <?php
 $image_src = Ansel::getImageUrl($image_id, 'full');
index aa3d0b5..918d334 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <div id="prevDiv"></div>
 <?php
index 227561e..4c9f9b0 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <?php
 $base_url = Horde::url('image.php');
 $base_url = $base_url->copy()->add(array_merge(
index d4063b1..af77e34 100644 (file)
@@ -1,4 +1,4 @@
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <?php
 $base_url = Horde::url('image.php')->add(
         array_merge(
index 0e6ef7b..b86303c 100644 (file)
@@ -29,7 +29,7 @@ function resetImage()
     document.slider.setValue(<?php echo $geometry['height'] ?>);
 }
 </script>
-<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, 'UTF-8') ?></h1>
+<h1 class="header"><?php echo htmlspecialchars($title) ?></h1>
 <div class="control anselActions" style="text-align: center">
 <?php
 $image_src = Ansel::getImageUrl($image_id, 'full');
index ae75fe3..ab02f87 100644 (file)
@@ -2,6 +2,6 @@
  <span class="rightFloat">
   <?php ($galleries_perpage < $num_galleries) ? printf(_("%d to %d of %d Galleries"), $start, $end, $num_galleries) : printf(ngettext("%d Gallery", "%d Galleries", $num_galleries), $num_galleries) ?>
  </span>
- <?php echo @htmlspecialchars($list_title, ENT_COMPAT, 'UTF-8') . ' ' . Horde::url($refresh_link)->link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
+ <?php echo htmlspecialchars($list_title) . ' ' . Horde::url($refresh_link)->link(array('title' => _("Refresh List"))) . Horde::img('reload.png', _("Refresh List")) . '</a>' ?>
 </div>
 <table width="100%" style="background:<?php echo $styleDef->background ?>;"><tr>
index e7d9c89..d231509 100644 (file)
@@ -66,7 +66,7 @@ $allLink = (!empty($this->_owner)) ? Horde::selfUrl()->add(array('view' => 'Resu
 if ($total) {
     echo '<span class="rightFloat">' . ($total > $this->_perPage ? sprintf(_("%d to %d of %d Items"), $this->_pagestart, $this->_pageend, $total) : sprintf(ngettext("%d Item", "%d Items", $total), $total)) . '<small>' . $allLink . '</small></span>';
 }
-echo htmlspecialchars($this->getTitle(), ENT_COMPAT, 'UTF-8') . $this->_search->getTagTrail();
+echo htmlspecialchars($this->getTitle()) . $this->_search->getTagTrail();
 ?>
 </div>
 
index f42255d..a45f14d 100755 (executable)
@@ -21,7 +21,7 @@
     <?php echo _("New Gallery Description") ?>
   </td>
   <td align="left">
-    <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc, ENT_COMPAT, 'UTF-8') ?></textarea>
+    <textarea name="gallery_desc" cols="33" rows="5"><?php echo htmlspecialchars($gallery_desc) ?></textarea>
   </td>
 </tr>
 </table>
index bd2626d..eaa3d5b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 7be23e4..24995b7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
@@ -16,7 +16,7 @@ if (!empty($title)) {
 Horde::outputMetaTags();
 
 if (Horde_Util::nonInputVar('js_vars')) {
-    Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, 'UTF-8'));
+    Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON));
 }
 
 Horde::includeScriptFiles();
index 1ad6d39..86b9c2a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index e27b2ae..71c537b 100644 (file)
@@ -34,4 +34,4 @@ if ($block instanceof PEAR_Error) {
     }
 }
 
-echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, 'UTF-8');
+echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON);
index 39a6684..30caa10 100644 (file)
@@ -92,9 +92,9 @@ class Horde_Block_Layout_View_Js extends Horde_Block_Layout_View {
             }
         }
 
-        $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, 'UTF-8');
-        $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, 'UTF-8');
-        $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, 'UTF-8');
+        $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON);
+        $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON);
+        $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON);
 
         $js_init .= 'portal.add(new Xilinus.Widget().'
                     . 'setTitle(title_' . $js_id .').'
index 5766c36..3b28ef6 100644 (file)
@@ -662,7 +662,7 @@ if ($pageOb['mode'] == 'edit') {
     /* Add current date in first field if no postings. */
     foreach ($postings as $key => $value) {
         if ($value['date'] == '') {
-            $js_onload[] = '$("date1").setValue(' . Horde_Serialize::serialize(strftime($datefmt), Horde_Serialize::JSON, 'UTF-8') . ')';
+            $js_onload[] = '$("date1").setValue(' . Horde_Serialize::serialize(strftime($datefmt), Horde_Serialize::JSON) . ')';
         }
         break;
     }
index 1dc19c1..87fa31c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index b35638e..792811f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 6c7d321..716685d 100644 (file)
@@ -1,4 +1,4 @@
-<?php echo '<?xml version="1.0" encoding="' . 'UTF-8' . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>
 
 <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
index d98eae0..d060a6b 100644 (file)
@@ -1,4 +1,4 @@
-<?php echo '<?xml version="1.0" encoding="' . 'UTF-8' . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>
 
 <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
index 3821cc4..4668214 100644 (file)
@@ -32,13 +32,6 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler
     protected $_mail;
 
     /**
-     * The message charset.
-     *
-     * @var string
-     */
-    protected $_charset;
-
-    /**
      * Constructor.
      *
      * @param array $params  Any parameters that the handler might need.
@@ -46,11 +39,10 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler
      *                       - identity: An identity factory that implements
      *                                   getIdentity().
      *                       - mail: A Horde_Mail_Transport instance.
-     *                       - charset: The charset of the messages.
      */
     public function __construct(array $params = null)
     {
-        foreach (array('identity', 'mail', 'charset') as $param) {
+        foreach (array('identity', 'mail') as $param) {
             if (!isset($params[$param])) {
                 throw new Horde_Alarm_Exception('Parameter \'' . $param . '\' missing.');
             }
@@ -63,7 +55,6 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler
         }
         $this->_identity = $params['identity'];
         $this->_mail     = $params['mail'];
-        $this->_charset  = $params['charset'];
     }
 
     /**
@@ -93,10 +84,10 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler
             'body' => empty($alarm['params']['mail']['body']) ? $alarm['text'] : $alarm['params']['mail']['body'],
             'to' => $email,
             'from' => $email,
-            'charset' => $this->_charset
+            'charset' => 'UTF-8'
         ));
         $mail->addHeader('Auto-Submitted', 'auto-generated');
-        $mail->addHeader('X-Horde-Alarm', $alarm['title'], $this->_charset);
+        $mail->addHeader('X-Horde-Alarm', $alarm['title'], 'UTF-8');
         $mail->send($this->_mail);
 
         $alarm['internal']['mail']['sent'] = true;
index 5af5341..a300ee6 100644 (file)
@@ -9,6 +9,7 @@
 
 class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase
 {
+    protected static $skip = false;
     protected static $pearConf;
     protected static $db;
     protected static $migrator;
@@ -32,7 +33,7 @@ class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase
             require $config;
         }
         if (!isset($conf['alarm']['test'])) {
-            self::markTestSkipped('No configuration for Horde_Alarm test.');
+            self::$skip = true;
             return;
         }
 
@@ -48,7 +49,16 @@ class Horde_Alarm_SqlTest extends PHPUnit_Framework_TestCase
 
     public static function tearDownAfterClass()
     {
-        self::$migrator->down();
+        if (self::$migrator) {
+            self::$migrator->down();
+        }
+    }
+
+    public function setUp()
+    {
+        if (self::$skip) {
+            $this->markTestSkipped('No configuration for Horde_Alarm test.');
+        }
     }
 
     public function testFactory()
index 0be4f4e..9cb7635 100644 (file)
@@ -241,7 +241,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout
                     try {
                         $message = Horde::callHook('perms_denied', array('horde:max_blocks'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = @htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks), ENT_COMPAT, 'UTF-8');
+                        $message = htmlspecialchars(sprintf(ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks));
                     }
                     $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
                     break;
index 745db8d..946b0d1 100644 (file)
@@ -555,8 +555,6 @@ HTML;
      */
     static public function sendHTTPResponse($data, $ct)
     {
-        $charset = 'UTF-8';
-
         // Output headers and encoded response.
         switch ($ct) {
         case 'json':
@@ -574,13 +572,13 @@ HTML;
              *
              * Finally, add prototypejs security delimiters to returned
              * JSON. */
-            $s_data = Horde_String::convertCharset(str_replace("\00", '', self::escapeJson($data, array('charset' => $charset))), $charset, 'UTF-8');
+            $s_data = str_replace("\00", '', self::escapeJson($data));
 
             if ($ct == 'json') {
                 header('Content-Type: application/json');
                 echo $s_data;
             } else {
-                header('Content-Type: text/html; charset=' . $charset);
+                header('Content-Type: text/html; charset=UTF-8');
                 echo htmlspecialchars($s_data);
             }
             break;
@@ -589,7 +587,7 @@ HTML;
         case 'plain':
         case 'xml':
             $s_data = is_string($data) ? $data : $data->response;
-            header('Content-Type: text/' . $ct . '; charset=' . $charset);
+            header('Content-Type: text/' . $ct . '; charset=UTF-8');
             echo $s_data;
             break;
 
@@ -606,8 +604,6 @@ HTML;
      * @param mixed $data     The data to JSON-ify.
      * @param array $options  Additional options:
      * <pre>
-     * 'charset' - (string) The charset of $data.
-     *             DEFAULT: Horde_Registry::getCharset()
      * 'nodelimit' - (boolean) Don't add security delimiters?
      *               DEFAULT: false
      * 'urlencode' - (boolean) URL encode the json string
@@ -618,7 +614,7 @@ HTML;
      */
     static public function escapeJson($data, array $options = array())
     {
-        $json = Horde_Serialize::serialize($data, Horde_Serialize::JSON, empty($options['charset']) ? 'UTF-8' : $options['charset']);
+        $json = Horde_Serialize::serialize($data, Horde_Serialize::JSON);
         if (empty($options['nodelimit'])) {
             $json = '/*-secure-' . $json . '*/';
         }
@@ -1135,16 +1131,9 @@ HTML;
         }
         if (!empty($title)) {
             if ($escape) {
-                $charset = 'UTF-8';
-                $old_error = error_reporting(0);
                 $title = str_replace(
                     array("\r", "\n"), '',
-                    htmlspecialchars(
-                        nl2br(htmlspecialchars($title, ENT_QUOTES, $charset)),
-                        ENT_QUOTES, $charset));
-
-                error_reporting($old_error);
-
+                    htmlspecialchars(nl2br(htmlspecialchars($title))));
                 /* Remove double encoded entities. */
                 $title = preg_replace('/&amp;([a-z]+|(#\d+));/i', '&\\1;', $title);
             }
@@ -1176,9 +1165,7 @@ HTML;
                                        $attributes = array())
     {
         if (!empty($title)) {
-            $charset = 'UTF-8';
-            $old_error = error_reporting(0);
-            $title = '&lt;pre&gt;' . preg_replace(array('/\n/', '/((?<!<br)\s{1,}(?<!\/>))/em', '/<br \/><br \/>/', '/<br \/>/'), array('', 'str_repeat("&nbsp;", strlen("$1"))', '&lt;br /&gt; &lt;br /&gt;', '&lt;br /&gt;'), nl2br(htmlspecialchars(htmlspecialchars($title, ENT_QUOTES, $charset), ENT_QUOTES, $charset))) . '&lt;/pre&gt;';
+            $title = '&lt;pre&gt;' . preg_replace(array('/\n/', '/((?<!<br)\s{1,}(?<!\/>))/em', '/<br \/><br \/>/', '/<br \/>/'), array('', 'str_repeat("&nbsp;", strlen("$1"))', '&lt;br /&gt; &lt;br /&gt;', '&lt;br /&gt;'), nl2br(htmlspecialchars(htmlspecialchars($title)))) . '&lt;/pre&gt;';
             error_reporting($old_error);
 
             self::addScriptFile('tooltips.js', 'horde');
@@ -1276,11 +1263,9 @@ HTML;
      */
     static public function img($src, $alt = '', $attr = '')
     {
-        $charset = 'UTF-8';
-
         /* If browser does not support images, simply return the ALT text. */
         if (!$GLOBALS['browser']->hasFeature('images')) {
-            return @htmlspecialchars($alt, ENT_COMPAT, $charset);
+            return htmlspecialchars($alt);
         }
 
         /* If no directory has been specified, get it from the registry. */
@@ -1297,7 +1282,7 @@ HTML;
         $img = '<img';
         $old_error = error_reporting(0);
         foreach ($attributes as $attribute => $value) {
-            $img .= ' ' . $attribute . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
+            $img .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"';
         }
         error_reporting($old_error);
 
@@ -1319,11 +1304,9 @@ HTML;
      */
     static public function fullSrcImg($src, $options = array())
     {
-        $charset = 'UTF-8';
-
         /* If browser does not support images, simply return the ALT text. */
         if (!$GLOBALS['browser']->hasFeature('images')) {
-            return @htmlspecialchars($alt, ENT_COMPAT, $charset);
+            return htmlspecialchars($alt);
         }
 
         /* If no directory has been specified, get it from the registry. */
@@ -1341,11 +1324,9 @@ HTML;
         if (!empty($options['attr'])) {
             /* Build all of the tag attributes. */
             if (is_array($options['attr'])) {
-                $old_error = error_reporting(0);
                 foreach ($options['attr'] as $attribute => $value) {
-                    $img .= ' ' . $attribute . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
+                    $img .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"';
                 }
-                error_reporting($old_error);
             }
             /* If the user supplied a pre-built string of attributes, add
              * that. */
@@ -1601,10 +1582,7 @@ HTML;
         if (isset($GLOBALS['registry']->nlsconfig['multibyte'][$GLOBALS['registry']->getLanguageCharset()])) {
             /* Prefix parenthesis with the UTF-8 representation of the LRO
              * (Left-to-Right-Override) Unicode codepoint U+202D. */
-            $prefix = ('UTF-8' == 'UTF-8')
-                ? "\xe2\x80\xad"
-                : '';
-            return $stripped_label . $prefix . '(<span class="accessKey">'
+            return $stripped_label . "\xe2\x80\xad" . '(<span class="accessKey">'
                 . strtoupper($accessKey) . '</span>' . ')';
         }
 
@@ -1801,14 +1779,13 @@ HTML;
      */
     static public function addInlineJsVars($data, $ret = false, $onload = null)
     {
-        $charset = 'UTF-8';
         $out = array();
 
         foreach ($data as $key => $val) {
             if ($key[0] == '-') {
                 $key = substr($key, 1);
             } else {
-                $val = Horde_Serialize::serialize($val, Horde_Serialize::JSON, $charset);
+                $val = Horde_Serialize::serialize($val, Horde_Serialize::JSON);
             }
 
             $out[] = $key . '=' . $val;
index 32c5c46..b72ccbf 100644 (file)
@@ -73,7 +73,7 @@ class Horde_Core_Ajax_Imple_SpellChecker extends Horde_Core_Ajax_Imple
         }
 
         Horde::addInlineScript(array(
-            $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, 'UTF-8') . ')'
+            $this->_params['id'] . ' = new SpellChecker(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON) . ')'
         ), 'dom');
     }
 
index 016f7fa..6bfd76b 100644 (file)
@@ -89,7 +89,7 @@ abstract class Horde_Core_Auth_Signup_Base
                 'body' => $message,
                 'to' => $conf['signup']['email'],
                 'from' => $conf['signup']['email'],
-                'subject' => 'UTF-8'));
+                'charset' => 'UTF-8'));
             $mail->send($GLOBALS['injector']->getInstance('Horde_Mail'));
         }
     }
index a8bbc47..a4e6a90 100644 (file)
@@ -70,7 +70,6 @@ class Horde_Core_Factory_Alarm
         $handler_params = array(
             'identity' => $injector->getInstance('Horde_Prefs_Identity'),
             'mail' => $injector->getInstance('Horde_Mail'),
-            'charset' => 'UTF-8'
         );
         $alarm->addHandler('mail', new Horde_Alarm_Handler_Mail($handler_params));
 
index 14d2b0a..d61317f 100644 (file)
@@ -58,7 +58,6 @@ class Horde_Core_Factory_Crypt
         global $registry;
 
         $params = array_merge(array(
-            'charset' => 'UTF-8',
             'email_charset' => $registry->getEmailCharset(),
             'temp' => Horde::getTempDir()
         ), $params);
index cdc8355..330f119 100644 (file)
@@ -138,18 +138,6 @@ class Horde_Core_Factory_TextFilter
             break;
         }
 
-        /* Add charset information, if needed. */
-        if (!isset($params['charset'])) {
-            switch ($lc_driver) {
-            case 'cleanhtml':
-            case 'html2text':
-            case 'space2html':
-            case 'text2html':
-                $params['charset'] = 'UTF-8';
-                break;
-            }
-        }
-
         return array($driver, $params);
     }
 
index ab66ec8..94d2c83 100644 (file)
@@ -55,7 +55,7 @@ class Horde_Core_Prefs_Identity extends Horde_Prefs_Identity
 
         $body = new Horde_Mime_Part();
         $body->setType('text/plain');
-        $body->setContents(Horde_String::wrap($message, 76, "\n"));
+        $body->setContents(Horde_String::wrap($message, 76));
         $body->setCharset('UTF-8');
 
         $body->send($new_addr, $msg_headers, $GLOBALS['injector']->getInstance('Horde_Mail'));
index 46e7ae6..8577ba6 100644 (file)
@@ -774,7 +774,7 @@ class Horde_Core_Prefs_Ui
                     // Fall-through
 
                 default:
-                    $val2 = Horde_String::convertCharset($val, 'UTF-8', 'UTF-8');
+                    $val2 = $val;
                 }
 
                 // [0] = pref name
index 52201d1..ee6d017 100644 (file)
@@ -103,7 +103,7 @@ class Horde_Core_Tree_Javascript extends Horde_Core_Tree_Html
         }
 
         Horde::addInlineScript(array(
-            'window.' . $js_var . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, 'UTF-8') . ')'
+            'window.' . $js_var . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON) . ')'
         ), 'dom');
 
         return '<div id="' . $this->_instance . '"></div>';
index 2bf8d84..bcb31bb 100644 (file)
@@ -23,13 +23,6 @@ class Horde_Core_Ui_VarRenderer
     protected $_params;
 
     /**
-     * Charset to use for output.
-     *
-     * @var string
-     */
-    protected $_charset;
-
-    /**
      * Constructs a new renderer.
      *
      * @param array $params  The name of the variable which will track this UI
@@ -38,7 +31,6 @@ class Horde_Core_Ui_VarRenderer
     public function __construct($params = array())
     {
         $this->_params = $params;
-        $this->_charset = 'UTF-8';
     }
 
     /**
index 4543cc0..b46fa83 100644 (file)
@@ -2317,15 +2317,11 @@ class Horde_Registry
      * @param string $app        The application name.
      * @param string $directory  The directory where the application's
      *                           LC_MESSAGES directory resides.
-     * @param string $charset    The charset.
      */
-    public function setTextdomain($app, $directory, $charset = 'UTF-8')
+    public function setTextdomain($app, $directory)
     {
         bindtextdomain($app, $directory);
         textdomain($app);
-        if (!Horde::contentSent()) {
-            header('Content-Type: text/html; charset=' . $charset);
-        }
     }
 
     /**
index 46b7e0f..09ba762 100644 (file)
@@ -67,8 +67,6 @@ class Horde_Crypt
      *
      * @param array $params  Configuration parameters:
      * <pre>
-     * 'charset' - (string) The default charset.
-     *             DEFAULT: NONE
      * 'email_charset' - (string) The default email charset.
      *                   DEFAULT: NONE
      * 'temp' - (string) [REQUIRED] Location of temporary directory.
@@ -85,7 +83,6 @@ class Horde_Crypt
         $this->_tempdir = Horde_Util::createTempDir(true, $params['temp']);
 
         $this->_params = array_merge(array(
-            'charset' => null,
             'email_charset' => null,
         ), $params);
     }
index ff41e75..2f01351 100644 (file)
@@ -1327,7 +1327,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
             '--armor',
             '--always-trust',
             '--batch',
-            '--charset ' . $this->_params['charset'],
+            '--charset UTF-8',
             $keyring,
             '--verify'
         );
@@ -1403,7 +1403,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $pgp_sign->setType('application/pgp-signature');
         $pgp_sign->setCharset($this->_params['email_charset']);
         $pgp_sign->setDisposition('inline');
-        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), $this->_params['charset'], $this->_params['email_charset']));
+        $pgp_sign->setDescription(Horde_String::convertCharset(_("PGP Digital Signature"), 'UTF-8', $this->_params['email_charset']));
         $pgp_sign->setContents($msg_sign, array('encoding' => '7bit'));
 
         /* Get the algorithim information from the signature. Since we are
@@ -1447,7 +1447,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part->setType('multipart/encrypted');
         $part->setCharset($this->_params['email_charset']);
         $part->setContentTypeParameter('protocol', 'application/pgp-encrypted');
-        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), $this->_params['charset'], $this->_params['email_charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Encrypted Data"), 'UTF-8', $this->_params['email_charset']));
         $part->setContents("This message is in MIME format and has been PGP encrypted.\n");
 
         $part1 = new Horde_Mime_Part();
@@ -1490,7 +1490,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part->setContents("This message is in MIME format and has been PGP signed and encrypted.\n");
 
         $part->setCharset($this->_params['email_charset']);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), $this->_params['charset'], $this->_params['email_charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Signed/Encrypted Data"), 'UTF-8', $this->_params['email_charset']));
 
         return $part;
     }
@@ -1508,7 +1508,7 @@ class Horde_Crypt_Pgp extends Horde_Crypt
         $part = new Horde_Mime_Part();
         $part->setType('application/pgp-keys');
         $part->setCharset($this->_params['email_charset']);
-        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), $this->_params['charset'], $this->_params['charset']));
+        $part->setDescription(Horde_String::convertCharset(_("PGP Public Key"), 'UTF-8', $this->_params['email_charset']));
         $part->setContents($key, array('encoding' => '7bit'));
 
         return $part;
index 4a27a76..a05217f 100644 (file)
@@ -280,7 +280,7 @@ class Horde_Crypt_Smime extends Horde_Crypt
 
         $msg = new Horde_Mime_Part();
         $msg->setCharset($this->_params['email_charset']);
-        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), $this->_params['charset'], $this->_params['email_charset']));
+        $msg->setDescription(Horde_String::convertCharset(_("S/MIME Encrypted Message"), 'UTF-8', $this->_params['email_charset']));
         $msg->setDisposition('inline');
         $msg->setType('application/pkcs7-mime');
         $msg->setContentTypeParameter('smime-type', 'enveloped-data');
index 004619a..aee91f9 100644 (file)
@@ -450,8 +450,7 @@ class DataTree_sql extends DataTree {
         if (is_a($name, 'PEAR_Error')) {
             return null;
         } else {
-            $name = Horde_String::convertCharset($name, $this->_params['charset'],
-                                           'UTF-8');
+            $name = Horde_String::convertCharset($name, $this->_params['charset'], 'UTF-8');
             // Get the parent names, if any.
             $parent = $this->getParentById($id);
             if ($parent && !is_a($parent, 'PEAR_Error') &&
@@ -1019,7 +1018,7 @@ 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());
                 }
 
                 $data[$id] = (is_null($data[$id]) || !is_array($data[$id]))
@@ -1103,8 +1102,8 @@ class DataTree_sql extends DataTree {
             $rows = $this->_db->getAll($query, DB_FETCHMODE_ASSOC);
             for ($i = 0; $i < count($rows); $i++) {
                 $rows[$i]['value'] = Horde_String::convertCharset($rows[$i]['value'],
-                                                            $this->_params['charset'],
-                                                            'UTF-8');
+                                                                  $this->_params['charset'],
+                                                                  'UTF-8');
             }
             return $rows;
         }
index 45d18c8..6c49aba 100644 (file)
@@ -21,7 +21,6 @@ class Horde_Date_RecurrenceTest extends PHPUnit_Framework_TestCase
 {
     protected function setUp()
     {
-        Horde_String::setDefaultCharset('UTF-8');
         $this->ical = new Horde_Icalendar();
         $this->_oldTimezone = date_default_timezone_get();
         date_default_timezone_set('Europe/Berlin');
index 667a772..4b21289 100644 (file)
@@ -213,7 +213,7 @@ try {
                 }
             }
         }
-        echo '<input type="hidden" name="_formvars" value="' . @htmlspecialchars(serialize($vars), ENT_QUOTES, 'UTF-8') . '" />';
+        echo '<input type="hidden" name="_formvars" value="' . htmlspecialchars(serialize($vars)) . '" />';
     }
 
     function renderFormActive(&$form, &$vars)
index 1fcd03b..a9213f8 100644 (file)
@@ -304,10 +304,8 @@ class Horde_Group_Kolab extends Horde_Group_Ldap
             }
 
             $groups = array();
-            $current_charset = 'UTF-8';
             for ($i = 0; $i < $result['count']; $i++) {
-                $utf8_dn = Horde_String::convertCharset($result[$i]['dn'], 'UTF-8', $current_charset);
-                $groups[$utf8_dn] = $this->getGroupName($utf8_dn);
+                $groups[$result[$i]['dn']] = $this->getGroupName($result[$i]['dn']);
             }
 
             $cache[$user] = $groups;
index f91cec5..486229d 100644 (file)
@@ -280,7 +280,6 @@ class Horde_Group_Ldap extends Horde_Group
      */
     public function getGroupName($dn)
     {
-        $dn = Horde_String::convertCharset($dn, 'UTF-8', 'UTF-8');
         $result = @ldap_explode_dn($dn, 1);
         if ($result === false) {
             throw new Horde_Group_Exception('Invalid group ID passed (bad DN syntax)');
@@ -530,10 +529,8 @@ class Horde_Group_Ldap extends Horde_Group
         }
 
         $this->_userCache[$user] = array();
-        $current_charset = 'UTF-8';
         foreach ($search as $dn => $entry) {
-            $utf8_dn = Horde_String::convertCharset($dn, 'UTF-8', $current_charset);
-            $this->_userCache[$user][$utf8_dn] = $this->getGroupName($utf8_dn);
+            $this->_userCache[$user][$dn] = $this->getGroupName($dn);
         }
 
         return $this->_userCache[$user];
index 655c7a5..8e67131 100644 (file)
@@ -540,20 +540,12 @@ class Horde_Icalendar
      *
      * @param string $text     The data to parse.
      * @param string $base     The type of the base object.
-     * @param string $charset  The encoding charset for $text. Defaults to
-     *                         utf-8 for new format, iso-8859-1 for old format.
-     * @param boolean $clear   If true clears the iCal object before parsing.
      *
      * @return boolean  True on successful import, false otherwise.
      * @throws Horde_Icalendar_Exception
      */
-    public function parsevCalendar($text, $base = 'VCALENDAR',
-                                   $charset = null, $clear = true)
+    public function parsevCalendar($text, $base = 'VCALENDAR')
     {
-        if ($clear) {
-            $this->clear();
-        }
-
         if (preg_match('/^BEGIN:' . $base . '(.*)^END:' . $base . '/ism', $text, $matches)) {
             $container = true;
             $vCal = $matches[1];
@@ -579,7 +571,7 @@ class Horde_Icalendar
                 if ($component === false) {
                     throw new Horde_Icalendar_Exception('Unable to create object for type ' . $type);
                 }
-                $component->parsevCalendar($data, $type, $charset);
+                $component->parsevCalendar($data, $type);
 
                 $this->addComponent($component);
 
@@ -597,7 +589,7 @@ class Horde_Icalendar
                 if ($component === false) {
                     throw new Horde_Icalendar_Exception('Unable to create object for type ' . $type);
                 }
-                $component->parsevCalendar($data, $type, $charset);
+                $component->parsevCalendar($data, $type);
 
                 $this->addComponent($component);
 
@@ -665,15 +657,9 @@ class Horde_Icalendar
                     $value = quoted_printable_decode($value);
                     if (isset($params['CHARSET'])) {
                         $value = Horde_String::convertCharset($value, $params['CHARSET']);
-                    } else {
-                        $value = Horde_String::convertCharset($value, empty($charset) ? ($this->oldFormat ? 'iso-8859-1' : 'utf-8') : $charset);
-                    }
+                     }
                 } elseif (isset($params['CHARSET'])) {
                     $value = Horde_String::convertCharset($value, $params['CHARSET']);
-                } else {
-                    // As per RFC 2279, assume UTF8 if we don't have an
-                    // explicit charset parameter.
-                    $value = Horde_String::convertCharset($value, empty($charset) ? ($this->oldFormat ? 'iso-8859-1' : 'utf-8') : $charset);
                 }
 
                 // Get timezone info for date fields from $params.
@@ -1092,7 +1078,7 @@ class Horde_Icalendar
                 $attr_string = $name . $params_str . ':' . $value;
                 if (!$this->oldFormat) {
                     $attr_string = Horde_String::wordwrap($attr_string, 75, $this->_newline . ' ',
-                                                    true, 'utf-8', true);
+                                                          true, 'utf-8', true);
                 }
                 $result .= $attr_string . $this->_newline;
             }
index 1bbd030..8aa472d 100644 (file)
@@ -40,7 +40,7 @@ STATUS:NEEDS ACTION
 END:VEVENT
 END:VCALENDAR';
 
-$ical->parseVCalendar($data, 'VCALENDAR', 'UTF-8');
+$ical->parseVCalendar($data, 'VCALENDAR');
 $event = $ical->getComponent(0);
 var_dump($event->getAttribute('SUMMARY'));
 
index 8f7e83d..66074c0 100644 (file)
@@ -188,7 +188,7 @@ class Horde_Itip_Response
         $body = new Horde_Mime_Part();
         $body->setType('text/plain');
         $options->prepareMessageMimePart($body);
-        $body->setContents(Horde_String::wrap($type->getMessage(), 76, "\n"));
+        $body->setContents(Horde_String::wrap($type->getMessage(), 76));
 
         $message->addPart($body);
         $message->addPart($ics);
index 784c84a..fd21a3a 100644 (file)
@@ -461,7 +461,7 @@ class Kolab {
             return $default;
         }
 
-        return Horde_String::convertCharset($element->get_content(), 'utf-8');
+        return $element->get_content();
     }
 
     function getVal($name, $default = 0)
@@ -526,7 +526,7 @@ class Kolab {
 
     function &setElemStr(&$parent, $name, $value = '')
     {
-        return $this->setElemVal($parent, $name, Horde_String::convertCharset($value, 'UTF-8', 'utf-8'));
+        return $this->setElemVal($parent, $name, $value);
     }
 
     function &setVal($name, $value = '')
index 001a3d6..0896c1d 100644 (file)
@@ -111,7 +111,7 @@ class Horde_Kolab_Filter_Configuration
 
         if (!empty($conf['kolab']['filter']['locale_path'])
             && !empty($conf['kolab']['filter']['locale'])) {
-            Horde_Nls::setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path'], Horde_Nls::getCharset());
+            Horde_Nls::setTextdomain('Kolab_Filter', $conf['kolab']['filter']['locale_path']);
             setlocale(LC_ALL, $conf['kolab']['filter']['locale']);
         }
 
index a7d46bc..b1abcc5 100644 (file)
@@ -775,11 +775,7 @@ class Horde_Kolab_Format_Xml
      */
     protected function _createTextNode($parent, $name, $value)
     {
-        $value = Horde_String::convertCharset($value, 'UTF-8',
-                                              'utf-8');
-
         $node = $this->_xmldoc->createElement($name);
-
         $node = $parent->appendChild($node);
 
         // content
@@ -847,7 +843,7 @@ class Horde_Kolab_Format_Xml
      */
     protected function _getNodeContent($node)
     {
-        return Horde_String::convertCharset($node->textContent, 'utf-8');
+        return $node->textContent;
     }
 
 
index 5b8dc11..8fcf830 100644 (file)
@@ -560,7 +560,7 @@ class Kolab_Resource
 
             Horde::logMessage(sprintf('Sending confirmation of cancelation to %s', $organiser), 'WARNING');
 
-            $body = new MIME_Part('text/plain', Horde_String::wrap($body, 76, "\n", 'utf-8'), 'utf-8');
+            $body = new MIME_Part('text/plain', Horde_String::wrap($body, 76));
             $mime = &MIME_Message::convertMimePart($body);
             $mime->setTransferEncoding('quoted-printable');
             $mime->transferEncodeContents();
index 23bfcc0..7e5072d 100644 (file)
@@ -95,13 +95,11 @@ class Horde_Kolab_Resource_Freebusy_Kolab extends Horde_Kolab_Resource_Freebusy
         $contentType = $http->getResponseHeader('Content-Type');
         if ($contentType && strpos($contentType, ';') !== false) {
             list(,$charset,) = explode(';', $contentType);
-            $charset         = trim(str_replace('charset=', '', $charset));
-        } else {
-            $charset = 'UTF-8';
+            $vfb_text = Horde_String::convertCharset($vfb_text, trim(str_replace('charset=', '', $charset)), 'UTF-8');
         }
 
         $iCal = new Horde_Icalendar();
-        $iCal->parsevCalendar($vfb_text, 'VCALENDAR', $charset);
+        $iCal->parsevCalendar($vfb_text, 'VCALENDAR');
 
         $vfb = &$iCal->findComponent('VFREEBUSY');
 
index a5780e9..8083424 100644 (file)
@@ -43,13 +43,6 @@ implements Iterator
     protected $_namespaces = array();
 
     /**
-     * The characterset this module uses to communicate with the outside world.
-     *
-     * @var string
-     */
-    protected $_charset;
-
-    /**
      * A prefix in the shared namespaces that will be ignored/removed.
      *
      * @var string
@@ -84,7 +77,6 @@ implements Iterator
      */
     public function __construct()
     {
-        $this->_charset = 'UTF-8';
         if (empty($this->_primaryPersonalNamespace)) {
             $personal = null;
             foreach ($this->_namespaces as $namespace) {
@@ -135,7 +127,7 @@ implements Iterator
      */
     public function getCharset()
     {
-        return $this->_charset;
+        throw new Exception('This method is deprecated, assume UTF-8');
     }
 
     /**
@@ -147,7 +139,7 @@ implements Iterator
      */
     public function getTitle($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getTitle($name);
     }
 
@@ -160,7 +152,7 @@ implements Iterator
      */
     public function getOwner($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getOwner($name);
     }
 
@@ -173,7 +165,7 @@ implements Iterator
      */
     public function getSubpath($name)
     {
-        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', $this->_charset);
+        $name = Horde_String::convertCharset($name, 'UTF7-IMAP', 'UTF-8');
         return $this->matchNamespace($name)->getSubpath($name);
     }
 
@@ -194,7 +186,7 @@ implements Iterator
             array_unshift($path, $this->_primaryPersonalNamespace->getName());
             $namespace = $this->_primaryPersonalNamespace;
         }
-        return Horde_String::convertCharset($namespace->generateName($path), $this->_charset, 'UTF7-IMAP');
+        return Horde_String::convertCharset($namespace->generateName($path), 'UTF-8', 'UTF7-IMAP');
     }
 
     function rewind()
index e493429..dbe98d0 100644 (file)
@@ -1056,7 +1056,7 @@ implements Horde_Kolab_Storage_Folder
         $part = new Horde_Mime_Part();
         $part->setType('text/plain');
         $part->setName('Kolab Groupware Information');
-        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n", 'UTF-8'));
+        $part->setContents(Horde_String::wrap($kolab_text, 76, "\r\n"));
         $part->setCharset('UTF-8');
 
         $part->setTransferEncoding('quoted-printable');
index f0639d9..a97d0ae 100644 (file)
@@ -13,6 +13,10 @@ class Horde_Ldap_LdapTest extends Horde_Ldap_TestBase
 {
     public static function tearDownAfterClass()
     {
+        if (!self::$ldapcfg) {
+            return;
+        }
+
         $ldap = new Horde_Ldap(self::$ldapcfg['server']);
         $clean = array('cn=Horde_Ldap_TestEntry,',
                        'ou=Horde_Ldap_Test_subdelete,',
index 2f71137..e02afa7 100644 (file)
@@ -13,6 +13,9 @@ class Horde_Ldap_SearchTest extends Horde_Ldap_TestBase
 {
     public static function tearDownAfterClass()
     {
+        if (!self::$ldapcfg) {
+            return;
+        }
         $ldap = new Horde_Ldap(self::$ldapcfg['server']);
         $ldap->delete('ou=Horde_Ldap_Test_search1,' . self::$ldapcfg['server']['basedn']);
         $ldap->delete('ou=Horde_Ldap_Test_search2,' . self::$ldapcfg['server']['basedn']);
index 02fd9a1..fa66407 100644 (file)
@@ -31,8 +31,7 @@ class Horde_Mime_Address
      * @param string $personal  Personal name phrase.
      * @param array $opts  Additional options:
      * <pre>
-     * 'idn' - (boolean) Convert IDN domain names (Punycode/RFC 3490) into
-     *         the local charset.
+     * 'idn' - (boolean) Decode IDN domain names (Punycode/RFC 3490).
      *         Requires the PECL idn module.
      *         DEFAULT: true
      * </pre>
@@ -53,7 +52,7 @@ class Horde_Mime_Address
         if ((!isset($opts['idn']) || !$opts['idn']) &&
             (stripos($host, 'xn--') === 0) &&
             function_exists('idn_to_utf8')) {
-            $host = Horde_String::convertCharset(idn_to_utf8($host), 'UTF-8');
+            $host = idn_to_utf8($host);
         }
 
         $address .= self::encode($mailbox, 'address') . '@' . $host;
index 705c1d7..4d624ad 100644 (file)
@@ -205,7 +205,7 @@ class Horde_Mime_Mail
     public function setBody($body, $charset = 'iso-8859-1', $wrap = false)
     {
         if ($wrap) {
-            $body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap, "\n");
+            $body = Horde_String::wrap($body, $wrap === true ? 76 : $wrap);
         }
         $this->_body = new Horde_Mime_Part();
         $this->_body->setType('text/plain');
index 6a75dc3..b7fbe2c 100644 (file)
@@ -49,10 +49,30 @@ class Horde_Mime_Viewer_Syntaxhighlighter extends Horde_Mime_Viewer_Base
         $language = $this->_mimeTypeToLanguage($mimeType);
         $brush = $this->_languageToBrush($language);
 
-        $results = '<pre class="brush: ' . $language . '">' . htmlspecialchars($this->_mimepart->getContents(), ENT_QUOTES, $this->getConfigParam('charset')) . '</pre>';
+        if (!$this->_shLoaded) {
+            Horde::addScriptFile('syntaxhighlighter/scripts/shCore.js', 'horde', true);
+            Horde::addInlineScript(array(
+                'SyntaxHighlighter.defaults[\'toolbar\'] = false;',
+                'SyntaxHighlighter.all();',
+            ), 'dom');
+            $this->_shLoaded = true;
+
+            $sh_js_fs = $GLOBALS['injector']->getInstance('Horde_Registry')->get('jsfs', 'horde') . '/syntaxhighlighter/styles/';
+            $sh_js_uri = Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->get('jsuri', 'horde'), false, -1) . '/syntaxhighlighter/styles/';
+            Horde_Themes::includeStylesheetFiles(array('additional' => array(
+                array('f' => $sh_js_fs . 'shCoreEclipse.css', 'u' => $sh_js_uri . 'shCoreEclipse.css'),
+                array('f' => $sh_js_fs . 'shThemeEclipse.css', 'u' => $sh_js_uri . 'shThemeEclipse.css'),
+            )));
+        }
+        if (empty($this->_shBrushes[$brush])) {
+            Horde::addScriptFile('syntaxhighlighter/scripts/shBrush' . $brush . '.js', 'horde', true);
+            $this->_shBrushes[$brush] = true;
+        }
+
+        $results = '<pre class="brush: ' . $language . '">' . htmlspecialchars($this->_mimepart->getContents()) . '</pre>';
         return $this->_renderReturn(
             $results,
-            'text/html; charset=' . $this->getConfigParam('charset')
+            'text/html; charset=UTF-8'
         );
     }
 
index f3bf168..5d0d4ce 100644 (file)
@@ -131,7 +131,7 @@ if (document.getElementById(%1$s)){
             }
         }
         echo '<input type="hidden" name="_formvars" value="'
-            . htmlspecialchars(serialize($vars), ENT_QUOTES, 'UTF-8')
+            . htmlspecialchars(serialize($vars))
             . '" />';
     }
 
index 5f7ea30..f600775 100644 (file)
@@ -91,7 +91,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
             . 'id="%2$s" value="%3$s"%4$s%5$s%6$s />',
             ($var->isDisabled() ? ' form-input-disabled" ' : ''),
             $var->getVarName(),
-            htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'),
+            htmlspecialchars($var->getValue($vars)),
             ($var->isDisabled() ? ' disabled="disabled" ' : ''),
             ($var->type->maxlength ? ' maxlength="' . $var->type->maxlength . '"' : ''),
             $this->_getActionScripts($form, $var)
@@ -113,7 +113,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         return sprintf(
             '<input type="text" class="form-input-phone" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
             $var->getVarName(),
-            htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'),
+            htmlspecialchars($var->getValue($vars)),
             ($var->isDisabled() ? ' disabled="disabled" ' : ''),
             $this->_getActionScripts($form, $var)
         );
@@ -128,7 +128,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
     {
         return sprintf('    <input type="text" class="form-input-ipaddress" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
                        $var->getVarName(),
-                       htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'),
+                       htmlspecialchars($var->getValue($vars)),
                        $var->isDisabled() ? ' disabled="disabled" ' : '',
                        $this->_getActionScripts($form, $var)
                );
@@ -459,7 +459,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         $prompt = $var->type->prompt;
         $htmlchars = $var->getOption('htmlchars');
         if ($prompt) {
-            $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, 'UTF-8') : $prompt) . '</option>';
+            $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt) : $prompt) . '</option>';
         }
         return sprintf('    <select name="%1$s" id="%1$s"%2$s>%3$s%4$s    </select>',
                $var->getVarName(),
@@ -488,7 +488,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
         /* Hidden tag to store the current first level. */
         $html = sprintf('    <input type="hidden" name="%1$s[old]" id="%1$s[old]" value="%2$s" />',
                         $varname,
-                        htmlspecialchars($selected['1'], ENT_QUOTES, 'UTF-8'));
+                        htmlspecialchars($selected['1']));
 
         /* First level. */
         $values_1 = Horde_Array::valuesToKeys(array_keys($values));
@@ -497,7 +497,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
                          'if (this.value) { document.' . $form->getName() . '.formname.value=\'\';' . 'document.' . $form->getName() . '.submit() }',
                          ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
         if (!empty($prompts)) {
-            $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, 'UTF-8') . '</option>';
+            $html .= '<option value="">' . htmlspecialchars($prompts[0]) . '</option>';
         }
         $html .= $this->_selectOptions($values_1, $selected['1']);
         $html .= '    </select>';
@@ -507,7 +507,7 @@ class Horde_Form_VarRenderer_Xhtml extends Horde_Form_VarRenderer
                          $varname,
                          ($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
         if (!empty($prompts)) {
-            $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, 'UTF-8') . '</option>';
+            $html .= '<option value="">' . htmlspecialchars($prompts[1]) . '</option>';
         }
         $values_2 = array();
         if (!empty($selected['1'])) {
@@ -778,8 +778,7 @@ EOT;
 
     function _renderVarDisplayDefault($form, $var, $vars)
     {
-        return nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES,
-            'UTF-8'));
+        return nl2br(htmlspecialchars($var->getValue($vars)));
     }
 
     function _renderVarDisplay_html($form, $var, $vars)
@@ -823,7 +822,7 @@ EOT;
             return Horde::link($mail_link, $email_val)
                 . htmlspecialchars($display_email) . '</a>';
         } else {
-            return nl2br(htmlspecialchars($display_email, ENT_QUOTES, 'UTF-8'));
+            return nl2br(htmlspecialchars($display_email));
         }
     }
 
@@ -854,7 +853,7 @@ EOT;
         if (count($values) == 0) {
             return _("No values");
         } elseif (isset($values[$value]) && $value != '') {
-            return htmlspecialchars($values[$value], ENT_QUOTES, 'UTF-8');
+            return htmlspecialchars($values[$value]);
         }
     }
 
@@ -864,7 +863,7 @@ EOT;
         if (count($values) == 0) {
             return _("No values");
         } elseif (isset($values[$var->getValue($vars)])) {
-            return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, 'UTF-8');
+            return htmlspecialchars($values[$var->getValue($vars)]);
         }
     }
 
@@ -881,7 +880,7 @@ EOT;
                     $display[] = $name;
                 }
             }
-            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8');
+            return htmlspecialchars(implode(', ', $display));
         }
     }
 
@@ -898,7 +897,7 @@ EOT;
                     $display[] = $name;
                 }
             }
-            return htmlspecialchars(implode(', ', $display), ENT_QUOTES, 'UTF-8');
+            return htmlspecialchars(implode(', ', $display));
         }
     }
 
@@ -1069,7 +1068,7 @@ EOT;
             }
         }
 
-        $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, 'UTF-8'));
+        $html = nl2br(htmlspecialchars($var->getValue($vars)));
         if (!empty($mapurl)) {
             $html .= '&nbsp;&nbsp;' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc) . '</a>';
         }
@@ -1107,7 +1106,7 @@ EOT;
     function _renderVarDisplay_invalid($form, $var, $vars)
     {
         return '<p class="form-error form-inline">'
-                . htmlspecialchars($var->type->message, ENT_QUOTES, 'UTF-8')
+                . htmlspecialchars($var->type->message)
                 . '</p>';
     }
 
@@ -1226,7 +1225,7 @@ EOT;
                 $selected = '';
             }
             $result .= '        <option value="';
-            $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, 'UTF-8') : $value;
+            $result .= ($htmlchars) ? htmlspecialchars($value) : $value;
             $result .= '"' . $selected . '>';
             $result .= ($htmlchars) ? htmlspecialchars($display) : $display;
             $result .= "</option>\n";
@@ -1246,7 +1245,7 @@ EOT;
                 $selected = '';
             }
             $result .= " <option value=\""
-                . htmlspecialchars($value, ENT_QUOTES, 'UTF-8')
+                . htmlspecialchars($value)
                 . "\"$selected>" . htmlspecialchars($display) . "</option>\n";
         }
 
index a4d5458..0874124 100644 (file)
@@ -656,7 +656,7 @@ class Horde_Release
 
         // Building and sending message
         $mail = new Horde_Mime_Mail();
-        $mail->setBody($body, 'utf-8', false);
+        $mail->setBody($body, 'UTF-8', false);
         $mail->addHeaders($headers);
         try {
             $class = 'Horde_Mail_Transport_' . ucfirst($this->_options['mailer']['type']);
index afad383..7af46c9 100644 (file)
@@ -182,13 +182,6 @@ class Horde_Rpc_Webdav extends Horde_Rpc
     var $_http_status = "200 OK";
 
     /**
-     * encoding of property values passed in
-     *
-     * @var string
-     */
-    var $_prop_encoding = "utf-8";
-
-    /**
      * Copy of $_SERVER superglobal array
      *
      * Derived classes may extend the constructor to
@@ -588,7 +581,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc
 
         // Handle certain standard properties specially
         if (in_array('displayname', $properties['DAV:'])) {
-            $props[] = $this->mkprop('displayname', Horde_String::convertCharset($item['name'], 'UTF-8', 'UTF-8'));
+            $props[] = $this->mkprop('displayname', $item['name']);
             unset($properties['DAV:']['displayname']);
         }
         if (in_array('getlastmodified', $properties['DAV:'])) {
@@ -1535,7 +1528,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc
                         default:
                             $propstats[$i]['D:prop']['D:'. $prop['name']] = $prop['val'];
                             #echo "     <D:$prop[name]>"
-                            #    . $this->_prop_encode(htmlspecialchars($prop['val']))
+                            #    . htmlspecialchars($prop['val'])
                             #    .     "</D:$prop[name]>\n";
                             break;
                         }
@@ -1636,7 +1629,7 @@ class Horde_Rpc_Webdav extends Horde_Rpc
 
             if ($responsedescr) {
                 echo "  <D:responsedescription>".
-                    $this->_prop_encode(htmlspecialchars($responsedescr)).
+                    htmlspecialchars($responsedescr).
                     "</D:responsedescription>\n";
             }
 
@@ -2783,25 +2776,6 @@ class Horde_Rpc_Webdav extends Horde_Rpc
     }
 
     /**
-     * UTF-8 encode property values if not already done so
-     *
-     * @param  string  text to encode
-     * @return string  utf-8 encoded text
-     */
-    function _prop_encode($text)
-    {
-        switch (strtolower($this->_prop_encoding)) {
-        case "utf-8":
-            return $text;
-        case "iso-8859-1":
-        case "iso-8859-15":
-        case "latin-1":
-        default:
-            return utf8_encode($text);
-        }
-    }
-
-    /**
      * Slashify - make sure path ends in a slash
      *
      * @param   string directory path
index d95c5e3..3130b28 100644 (file)
@@ -248,11 +248,7 @@ class Horde_Serialize
             $data = self::serialize($data, array(self::UTF7, self::BASIC), $params);
             break;
 
-        // $params = Source character set
         case self::JSON:
-            if (!empty($params)) {
-                $data = Horde_String::convertCharset($data, $params, 'UTF-8');
-            }
             $tmp = json_encode($data);
 
             /* Basic error handling attempts. Requires PHP 5.3+.
index fe892c8..d0000f2 100644 (file)
@@ -33,11 +33,6 @@ abstract class Horde_SpellChecker
     protected $_locale = 'en';
 
     /**
-     * @var string
-     */
-    protected $_encoding = 'utf-8';
-
-    /**
      * @var boolean
      */
     protected $_html = false;
index 5fca5b6..f434e1f 100644 (file)
@@ -46,13 +46,6 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker
             throw new Horde_Exception('Spellcheck failed. Command line: ' . $this->_cmd());
         }
 
-        $charset = 'UTF-8';
-
-        // Write to stdin.
-        if ($this->_encoding) {
-            $input = Horde_String::convertCharset($input, $charset, $this->_encoding);
-        }
-
         // The '^' character tells aspell to spell check the entire line.
         fwrite($pipes[0], '^' . $input);
         fclose($pipes[0]);
@@ -76,16 +69,9 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker
         proc_close($process);
 
         if (strlen($out) === 0) {
-            if ($this->_encoding) {
-                $err = Horde_String::convertCharset($err, $this->_encoding, $charset);
-            }
             throw new Horde_Exception('Spellcheck failed. Command line: ' . $this->_cmd());
         }
 
-        if ($this->_encoding) {
-            $out = Horde_String::convertCharset($out, $this->_encoding, $charset);
-        }
-
         // Parse output.
         $bad = $suggestions = array();
         $lines = explode("\n", $out);
@@ -126,7 +112,7 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker
      */
     protected function _cmd()
     {
-        $args = '';
+        $args = '--encoding=UTF-8';
 
         switch ($this->_suggestMode) {
         case self::SUGGEST_FAST:
@@ -141,17 +127,13 @@ class Horde_SpellChecker_Aspell extends Horde_SpellChecker
             $args .= ' --sug-mode=normal';
         }
 
-        if ($this->_encoding) {
-            $args .= ' --encoding=' . escapeshellarg($this->_encoding);
-        }
-
         $args .= ' --lang=' . escapeshellarg($this->_locale);
 
         if ($this->_html) {
             $args .= ' -H';
         }
 
-        return sprintf('%s -a %s', 'aspell', $args);
+        return 'aspell -a ' . $args;
     }
 
 }
index 667a43f..582b610 100644 (file)
@@ -31,7 +31,6 @@ class Horde_Text_Filter_Cleanhtml extends Horde_Text_Filter_Base
      */
     protected $_params = array(
         'body_only' => false,
-        'charset' => 'us-ascii',
         'size' => false
     );
 
@@ -62,17 +61,10 @@ class Horde_Text_Filter_Cleanhtml extends Horde_Text_Filter_Base
             'wrap' => 0
         );
 
-        if (strtolower($this->_params['charset']) == 'us-ascii') {
-            $tidy = @tidy_parse_string($text, $tidy_config, 'ascii');
-            $tidy->cleanRepair();
-            $text = tidy_get_output($tidy);
-        } else {
-            $tidy = @tidy_parse_string(Horde_String::convertCharset($text, $this->_params['charset'], 'UTF-8'), $tidy_config, 'utf8');
-            $tidy->cleanRepair();
-            $text = Horde_String::convertCharset(tidy_get_output($tidy), 'UTF-8', $this->_params['charset']);
-        }
+        $tidy = @tidy_parse_string($text, $tidy_config, 'utf8');
+        $tidy->cleanRepair();
 
-        return $text;
+        return tidy_get_output($tidy);
     }
 
 }
index 693dd01..a48dd80 100644 (file)
@@ -46,7 +46,6 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base
      */
     protected $_params = array(
         'callback' => null,
-        'charset' => 'UTF-8',
         'width' => 75
     );
 
@@ -94,8 +93,8 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base
     public function postProcess($text)
     {
         try {
-            $dom = new Horde_Domhtml($text, $this->_params['charset']);
-            $text = Horde_String::convertCharset($this->_node($dom->dom, $dom->dom), null, $this->_params['charset']);
+            $dom = new Horde_Domhtml($text, 'UTF-8');
+            $text = $this->_node($dom->dom, $dom->dom);
             $dom_convert = true;
         } catch (Exception $e) {
             $text = strip_tags(preg_replace("/\<br\s*\/?\>/i", "\n", $text));
@@ -111,7 +110,7 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base
             if ($dom_convert &&
                 $this->_params['_bq'] &&
                 class_exists('Horde_Text_Flowed')) {
-                $flowed = new Horde_Text_Flowed($text, $this->_params['charset']);
+                $flowed = new Horde_Text_Flowed($text, 'UTF-8');
                 $flowed->setOptLength($this->_params['width']);
                 $text = $flowed->toFlowed();
             } else {
index 17f902d..2cee356 100644 (file)
@@ -28,7 +28,6 @@ class Horde_Text_Filter_Space2html extends Horde_Text_Filter_Base
      * @var array
      */
     protected $_params = array(
-        'charset' => 'ISO-8859-1',
         'encode' => false,
         'encode_all' => false
     );
@@ -43,7 +42,7 @@ class Horde_Text_Filter_Space2html extends Horde_Text_Filter_Base
     public function preProcess($text)
     {
         if ($this->_params['encode']) {
-            $text = @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']);
+            $text = htmlspecialchars($text);
         }
         return $text;
     }
index 56e692e..37a24e6 100644 (file)
@@ -53,7 +53,6 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
      * @var array
      */
     protected $_params = array(
-        'charset' => 'ISO-8859-1',
         'class' => 'fixed',
         'emails' => false,
         'linkurls' => false,
@@ -63,21 +62,6 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
     );
 
     /**
-     * Constructor.
-     *
-     * @param array $params  Any parameters that the filter instance needs.
-     */
-    public function __construct($params = array())
-    {
-        parent::__construct($params);
-
-        // Use ISO-8859-1 instead of US-ASCII
-        if (Horde_String::lower($this->_params['charset']) == 'us-ascii') {
-            $this->_params['charset'] = 'iso-8859-1';
-        }
-    }
-
-    /**
      * Executes any code necessary before applying the filter patterns.
      *
      * @param string $text  The text before the filtering.
@@ -92,7 +76,7 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
         }
 
         if ($this->_params['parselevel'] == self::NOHTML_NOBREAK) {
-            return @htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']);
+            return htmlspecialchars($text);
         }
 
         if ($this->_params['parselevel'] < self::NOHTML) {
@@ -124,12 +108,12 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
 
         /* For level MICRO or NOHTML, start with htmlspecialchars(). */
         $old_error = error_reporting(0);
-        $text2 = htmlspecialchars($text, ENT_COMPAT, $this->_params['charset']);
+        $text2 = htmlspecialchars($text);
 
         /* Bad charset input in may result in an empty string. If so, try
          * using the default charset encoding instead. */
         if (!$text2) {
-            $text2 = htmlspecialchars($text, ENT_COMPAT);
+            $text2 = htmlspecialchars($text);
         }
         $text = $text2;
         error_reporting($old_error);
index 08d2748..90411e7 100644 (file)
@@ -6,8 +6,6 @@
  * Filter parameters:
  * ------------------
  * <pre>
- * 'charset' - (string) The charset of the text.
- *             DEFAULT: UTF-8
  * 'noprefetch' - (boolean) Disable DNS pre-fetching? See:
  *                https://developer.mozilla.org/En/Controlling_DNS_prefetching
  *                DEFAULT: false
@@ -45,7 +43,6 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
      * @var array
      */
     protected $_params = array(
-        'charset' => 'UTF-8',
         'noprefetch' => false,
         'return_document' => false,
         'return_dom' => false,
@@ -100,7 +97,7 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
     public function postProcess($text)
     {
         try {
-            $dom = new Horde_Domhtml($text, $this->_params['charset']);
+            $dom = new Horde_Domhtml($text, 'UTF-8');
         } catch (Exception $e) {
             return $text;
         }
@@ -138,7 +135,7 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base
             }
         }
 
-        return Horde_String::convertCharset($text, $dom->encoding, $this->_params['charset']);
+        return Horde_String::convertCharset($text, $dom->encoding, 'UTF-8');
     }
 
     /**
index 0a71c2f..a592d22 100644 (file)
@@ -335,10 +335,7 @@ Links:
 [3] mailto:jane.doe@example.com
 EOT;
 
-        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
-            'charset' => 'UTF-8',
-            'width' => 70
-        ));
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array('width' => 70));
 
         $this->assertEquals($text, $filter);
     }
index 4be30bc..b67b5d8 100644 (file)
@@ -471,7 +471,6 @@ class Horde_String
      * @param string $break          Character(s) to use when breaking lines.
      * @param boolean $cut           Whether to cut inside words if a line
      *                               can't be wrapped.
-     * @param string $charset        Character set to use when breaking lines.
      * @param boolean $line_folding  Whether to apply line folding rules per
      *                               RFC 822 or similar. The correct break
      *                               characters including leading whitespace
@@ -480,21 +479,13 @@ class Horde_String
      * @return string  String containing the wrapped text.
      */
     static public function wordwrap($string, $width = 75, $break = "\n",
-                                    $cut = false, $charset = null,
-                                    $line_folding = false)
+                                    $cut = false, $line_folding = false)
     {
-        /* Get the user's default character set if none passed in. */
-        if (is_null($charset)) {
-            $charset = self::$_charset;
-        }
-
-        $charset = self::_mbstringCharset($charset);
-        $string = self::convertCharset($string, $charset, 'utf-8');
         $wrapped = '';
 
-        while (self::length($string, 'utf-8') > $width) {
-            $line = self::substr($string, 0, $width, 'utf-8');
-            $string = self::substr($string, self::length($line, 'utf-8'), null, 'utf-8');
+        while (self::length($string, 'UTF-8') > $width) {
+            $line = self::substr($string, 0, $width, 'UTF-8');
+            $string = self::substr($string, self::length($line, 'UTF-8'), null, 'UTF-8');
 
             // Make sure didn't cut a word, unless we want hard breaks anyway.
             if (!$cut && preg_match('/^(.+?)((\s|\r?\n).*)/us', $string, $match)) {
@@ -538,7 +529,7 @@ class Horde_String
             $wrapped .= $line;
         }
 
-        return self::convertCharset($wrapped . $string, 'utf-8', $charset);
+        return $wrapped . $string;
     }
 
     /**
@@ -547,7 +538,6 @@ class Horde_String
      * @param string $text        String containing the text to wrap.
      * @param integer $length     Wrap $text at this number of characters.
      * @param string $break_char  Character(s) to use when breaking lines.
-     * @param string $charset     Character set to use when breaking lines.
      * @param boolean $quote      Ignore lines that are wrapped with the '>'
      *                            character (RFC 2646)? If true, we don't
      *                            remove any padding whitespace at the end of
@@ -556,7 +546,7 @@ class Horde_String
      * @return string  String containing the wrapped text.
      */
     static public function wrap($text, $length = 80, $break_char = "\n",
-                                $charset = null, $quote = false)
+                                $quote = false)
     {
         $paragraphs = array();
 
@@ -570,7 +560,7 @@ class Horde_String
                 if ($input != '-- ') {
                     $input = rtrim($input);
                 }
-                $line = self::wordwrap($input, $length, $break_char, false, $charset);
+                $line = self::wordwrap($input, $length, $break_char);
             }
 
             $paragraphs[] = $line;
index 07ff77b..65d7417 100644 (file)
@@ -272,7 +272,7 @@ Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit. Aliqüäm
 söllicitüdin fäücibüs mäüris Ã¤met.
 EOT
 ,
-            Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string));
         $this->assertEquals(
 <<<EOT
 Lörem ipsüm dölör sit Ã¤met,
@@ -281,7 +281,7 @@ Lörem ipsüm dölör sit Ã¤met,
   mäüris Ã¤met.
 EOT
 ,
-            Horde_String::wordwrap($string, 30, "\n  ", false, 'utf-8'));
+            Horde_String::wordwrap($string, 30, "\n  "));
 
         // Test existing line breaks.
         $string = "Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit.\nAliqüäm söllicitüdin fäücibüs mäüris Ã¤met.";
@@ -291,7 +291,7 @@ Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit.
 Aliqüäm söllicitüdin fäücibüs mäüris Ã¤met.
 EOT
 ,
-            Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string));
         $string = "Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit. Aliqüäm\nsöllicitüdin fäücibüs mäüris Ã¤met.";
         $this->assertEquals(
 <<<EOT
@@ -299,7 +299,7 @@ Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit. Aliqüäm
 söllicitüdin fäücibüs mäüris Ã¤met.
 EOT
 ,
-            Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string));
         $string = "Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing elit. Aliqüäm söllicitüdin\nfäücibüs mäüris Ã¤met.";
         $this->assertEquals(
 <<<EOT
@@ -308,7 +308,7 @@ söllicitüdin
 fäücibüs mäüris Ã¤met.
 EOT
 ,
-            Horde_String::wordwrap($string, 75, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string));
 
         // Test overlong words and word cut.
         $string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
@@ -318,7 +318,7 @@ Löremipsümdölörsitämet,
 cönsectetüerädipiscingelit.
 EOT
 ,
-            Horde_String::wordwrap($string, 15, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string, 15));
         $string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
         $this->assertEquals(
 <<<EOT
@@ -328,7 +328,7 @@ cönsectetüerädi
 piscingelit.
 EOT
 ,
-            Horde_String::wordwrap($string, 15, "\n", true, 'utf-8'));
+            Horde_String::wordwrap($string, 15, "\n", true));
 
         // Test whitespace at wrap width.
         $string = "Lörem ipsüm dölör sit Ã¤met, cönsectetüer Ã¤dipiscing";
@@ -338,14 +338,14 @@ Lörem ipsüm dölör sit Ã¤met,
 cönsectetüer Ã¤dipiscing
 EOT
 ,
-            Horde_String::wordwrap($string, 27, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string, 27));
         $this->assertEquals(
 <<<EOT
 Lörem ipsüm dölör sit Ã¤met,
 cönsectetüer Ã¤dipiscing
 EOT
 ,
-            Horde_String::wordwrap($string, 28, "\n", false, 'utf-8'));
+            Horde_String::wordwrap($string, 28));
 
         // Test line folding.
         $string = "Löremipsümdölörsitämet, cönsectetüerädipiscingelit.";
index f2e7f07..2305c76 100644 (file)
@@ -100,7 +100,7 @@ class Horde_View_Helper_Form_InstanceTag_Form extends Horde_View_Helper_Form_Ins
             $value = $this->valueBeforeTypeCast($this->object(), $options);
         }
 
-        return $this->contentTag('textarea', htmlentities($value, ENT_QUOTES, 'utf-8'), $options);
+        return $this->contentTag('textarea', htmlentities($value), $options);
     }
 
     public function toCheckBoxTag($options = array(), $checkedValue = '1', $uncheckedValue = '0')
index eb11677..d63dfc1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index f93207b..eb522e3 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-$charset = 'UTF-8';
-
 /* Variables used in core javascript files. */
 $var = array(
     'URI_AJAX' => Horde::getServiceLink('ajax', 'gollem')->url,
@@ -29,6 +27,6 @@ $gettext = array_map('addslashes', array(
 
 ?>
 <script type="text/javascript">//<![CDATA[
-var GollemVar = <?php echo Horde_Serialize::encode($var, Horde_Serialize::SERIALIZE_JSON, $charset) ?>;
-var GollemText = <?php echo Horde_Serialize::encode($gettext, Horde_Serialize::SERIALIZE_JSON, $charset) ?>;
+var GollemVar = <?php echo Horde_Serialize::encode($var, Horde_Serialize::SERIALIZE_JSON) ?>;
+var GollemText = <?php echo Horde_Serialize::encode($gettext, Horde_Serialize::SERIALIZE_JSON) ?>;
 //]]></script>
index 95d9d3e..fb34255 100644 (file)
@@ -29,8 +29,8 @@ if ($form->validate($vars)) {
     }
     $now = time();
     $timers[$now] = array('name' => Horde_String::convertCharset($vars->get('description'),
-                                                       'UTF-8',
-                                                       $prefs->getCharset()),
+                                                                 'UTF-8',
+                                                                 $prefs->getCharset()),
                           'time' => $now);
     $prefs->setValue('running_timers', serialize($timers), false);
 
index 73b6003..7c48361 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index c3a055b..5940d0c 100644 (file)
@@ -55,7 +55,7 @@ if (Horde_Util::getFormData('submitbutton') == _("Revert Configuration")) {
     }
     if ($fp = @fopen($path . '/conf.php', 'w')) {
         /* Can write, so output to file. */
-        fwrite($fp, Horde_String::convertCharset($php, 'UTF-8', 'iso-8859-1'));
+        fwrite($fp, $php);
         fclose($fp);
         $notification->push(sprintf(_("Successfully wrote %s"), Horde_Util::realPath($path . '/conf.php')), 'horde.success');
         $registry->clearCache();
index b4c4ed5..57c97b1 100644 (file)
@@ -57,10 +57,7 @@ if ($setup == 'conf' && $type == 'php') {
 
         $data .= 'if ($fp = @fopen(\'' . $path . '/conf.php\', \'w\')) {' . "\n";
         $data .= '    fwrite($fp, \'';
-        $data .= Horde_String::convertCharset(str_replace(array('\\', '\''),
-                                                    array('\\\\', '\\\''),
-                                                    $php),
-                                        'UTF-8', 'iso-8859-1');
+        $data .= str_replace(array('\\', '\''), array('\\\\', '\\\''), $php);
         $data .= '\');' . "\n";
         $data .= '    fclose($fp);' . "\n";
         $data .= '    echo \'' . sprintf('Saved %s configuration.', $app) . '\' . "\n";' . "\n";
index cca20f6..c06340a 100644 (file)
@@ -287,8 +287,6 @@ class Horde_Hooks
 //        $ldapServer = 'ldap.example.com';
 //        $ldapPort = '389';
 //        $searchBase = 'ou=people,o=example.com';
-//        $ldapcharset = 'utf-8';
-//        $outputcharset = 'UTF-8';
 //
 //        $ds = @ldap_connect($ldapServer, $ldapPort);
 //
@@ -311,7 +309,6 @@ class Horde_Hooks
 //
 //        ldap_close($ds);
 //
-//        $name = Horde_String::convertCharset($name, $ldapcharset, $outputcharset);
 //        return empty($name) ? $user : $name;
 //    }
 
index 8c00e32..10d135e 100644 (file)
@@ -118,7 +118,6 @@ $horde_nls_config = array(
         'cs_CZ' => 'ISO-8859-2',
         'el_GR' => 'ISO-8859-7',
         'et_EE' => 'ISO-8859-13',
-        'eu_ES' => 'UTF-8',
         'fa_IR' => 'UTF-8',
         'he_IL' => 'UTF-8',
         'hu_HU' => 'ISO-8859-2',
index 4369094..00f34e7 100644 (file)
@@ -2,6 +2,7 @@
 v4.0-cvs
 --------
 
+[jan] Require mandatory UTF-8 support for both servers and clients.
 [jan] Renamed Setup to Configuration and Options to Preferences.
 [mms] Moved sidebar code out of block/portal code (Request #9160).
 [cjh] Remove fckeditor, standardizing on ckeditor.
index b50cdd7..fec253f 100644 (file)
@@ -232,9 +232,8 @@ The following prerequisites are **REQUIRED** for Horde to function properly.
 
    c. UTF-8 support ``--enable-mbstring``
 
-      If these extensions are enabled, Horde can support multibyte character
-      sets like UTF-8 (meaning that content with any charset can be viewed
-      with any translation).
+      If these extensions are enabled, Horde can better support
+      multibyte character sets like UTF-8.
 
       For iconv support you should use the GNU libiconv library, which is more
       stable and supports more charsets, compared to other iconv
index 0c4ff09..b3f9522 100644 (file)
@@ -158,7 +158,7 @@ EOT;
         Horde::addInlineScript($script, 'dom');
 
         /* Get the user's most recent tweet */
-        $latestStatus = htmlspecialchars($this->_profile->status->text, ENT_COMPAT, 'UTF-8');
+        $latestStatus = htmlspecialchars($this->_profile->status->text);
 
         /* Build the UI */
         $html = '<div style="padding: 0 8px 8px">'
index c928488..2888d12 100644 (file)
@@ -353,7 +353,7 @@ class Horde_Test
         error_reporting(E_ALL);
 
         /* Set character encoding. */
-        header('Content-type: text/html; charset=utf-8');
+        header('Content-type: text/html; charset=UTF-8');
         header('Vary: Accept-Language');
     }
 
index 7de0e80..6531b96 100644 (file)
@@ -29,7 +29,7 @@ if (!count($layout_pref)) {
 // If we're serving a request to the JS update client, just return the blocks
 // updated HTML content.
 if (Horde_Util::getFormData('httpclient')) {
-    header('Content-Type: text/html; charset=' . 'UTF-8');
+    header('Content-Type: text/html; charset=UTF-8');
     $row = Horde_Util::getFormData('row');
     $col = Horde_Util::getFormData('col');
     if (!is_null($row) && !is_null($col) && !empty($layout_pref[$row][$col])) {
index 30d22dd..6d76801 100644 (file)
@@ -31,7 +31,6 @@ if (!Horde_Util::getFormData('ajaxui') &&
     $ajax_url = Horde::getServiceLink('ajax', 'horde');
     $ajax_url->pathInfo = 'sidebarUpdate';
 
-    $charset = 'UTF-8';
     $rtl = intval(isset($registry->nlsconfig['rtl'][$language]));
     $show_sidebar = !isset($_COOKIE['horde_sidebar_expanded']) || $_COOKIE['horde_sidebar_expanded'];
     $width = intval($prefs->getValue('sidebar_width'));
index 854907e..69f459b 100644 (file)
@@ -97,8 +97,8 @@ case 'getPage':
         /* These are all referencing the *original* tweet */
         $view->profileLink = Horde::externalUrl('http://twitter.com/' . htmlspecialchars($tweetObj->user->screen_name), true);
         $view->profileImg = $tweetObj->user->profile_image_url;
-        $view->authorName = htmlspecialchars($tweetObj->user->screen_name, ENT_COMPAT, 'UTF-8');
-        $view->authorFullname = htmlspecialchars($tweetObj->user->name, ENT_COMPAT, 'UTF-8');
+        $view->authorName = htmlspecialchars($tweetObj->user->screen_name);
+        $view->authorFullname = htmlspecialchars($tweetObj->user->name);
         $view->createdAt = $tweetObj->created_at;
         $view->clientText = $filter->filter($tweet->source, 'xss');
         $view->tweet = $tweet;
index 2e555cd..60c0434 100644 (file)
@@ -60,7 +60,7 @@
 <label for="new_user" class="hidden"><?php echo _("User") ?></label>
 <input type="text" id="new_user" name="new_user" />
 <?php endif; ?>
-<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName()), ENT_COMPAT, 'UTF-8') ?>" />
+<input type="submit" class="button" value="<?php echo htmlspecialchars(sprintf(_("Save \"%s\""), $group->getShortName())) ?>" />
 </p>
 <br />
 
index cf665bf..d222811 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($GLOBALS['language'])) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 93ea201..86ef99f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index d8adcbf..2d65d39 100644 (file)
@@ -356,7 +356,7 @@ class IMP_Mime_Viewer_Itip extends Horde_Mime_Viewer_Base
 
                     $message = _("Attached is a reply to a calendar request you sent.");
                     $body = new Horde_Mime_Part('text/plain',
-                                          Horde_String::wrap($message, 76, "\n"),
+                                          Horde_String::wrap($message, 76),
                                           $charset);
 
                     $ics = new Horde_Mime_Part('text/calendar', $vCal->exportvCalendar());
index b4ffa1d..e823448 100644 (file)
@@ -19,7 +19,7 @@ default:
 }
 
 if (isset($GLOBALS['language'])) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 31fcfe6..c71ecd7 100644 (file)
@@ -62,7 +62,7 @@ case 'rule_enable':
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:allow_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(_("You are not allowed to create or edit custom rules."));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break 2;
@@ -71,7 +71,7 @@ case 'rule_enable':
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:max_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break 2;
@@ -210,7 +210,7 @@ if (count($filter_list) == 0) {
 
         /* Create description. */
         if (!$edit_allowed) {
-            $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, 'UTF-8');
+            $entry['descriplink'] = htmlspecialchars($name);
         } elseif (!empty($filter['conditions'])) {
             $descrip = '';
             $condition_size = count($filter['conditions']) - 1;
@@ -239,9 +239,9 @@ if (count($filter_list) == 0) {
                 $descrip .= "\n[stop]";
             }
 
-            $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . '</a>';
+            $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . htmlspecialchars($name) . '</a>';
         } else {
-            $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . '</a>';
+            $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . htmlspecialchars($name) . '</a>';
         }
 
         /* Create edit link. */
index 47dfaa3..f765ab8 100644 (file)
@@ -457,7 +457,7 @@ class Ingo
         if ($GLOBALS['registry']->hasMethod('mail/createFolder')) {
             Horde::addScriptFile('new_folder.js', 'ingo');
             Horde::addInlineScript(array(
-                'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON, 'UTF-8')
+                'IngoNewFolder.folderprompt = ' . Horde_Serialize::serialize(_("Please enter the name of the new folder:"), Horde_Serialize::JSON)
             ));
         }
     }
index b5bd739..b02d6cc 100644 (file)
@@ -126,9 +126,6 @@ class Ingo_Script
         if (!isset($params['spam_char'])) {
             $params['spam_char'] = $GLOBALS['conf']['spam']['char'];
         }
-        if (!isset($params['charset'])) {
-            $params['charset'] = 'UTF-8';
-        }
         if ($script == 'Sieve') {
             if (!isset($params['date_format'])) {
                 $params['date_format'] = $GLOBALS['prefs']->getValue('date_format');;
index 4b2bfe4..8f79293 100644 (file)
@@ -131,7 +131,6 @@ class Ingo_Script_Sieve extends Ingo_Script
             . _("Generated by Ingo (http://www.horde.org/ingo/)") . ' ('
             . trim(strftime($this->_params['date_format'] . ', ' . $this->_params['time_format']))
             . ")\n\n";
-        $code = $this->encode($code);
         $requires = $this->requires();
 
         if (count($requires) > 1) {
@@ -155,18 +154,6 @@ class Ingo_Script_Sieve extends Ingo_Script
     }
 
     /**
-     * Encodes a string to UTF-8.
-     *
-     * @param string $string  The string to encode.
-     *
-     * @return string  The string, UTF-8 encoded.
-     */
-    public function encode($string)
-    {
-        return Horde_String::convertCharset($string, $this->_params['charset'], 'UTF-8');
-    }
-
-    /**
      * Escape a string according to Sieve RFC 3028 [2.4.2].
      *
      * @param string $string      The string to escape.
@@ -244,7 +231,7 @@ class Ingo_Script_Sieve extends Ingo_Script
 
         if (count($action)) {
             if($forward->getForwardKeep()) {
-                $this->_endBlocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Forward Keep Action")));
+                $this->_endBlocks[] = new Ingo_Script_Sieve_Comment(_("Forward Keep Action"));
                 $if = new Ingo_Script_Sieve_If(new Ingo_Script_Sieve_Test_True());
                 $if->setActions(array(new Ingo_Script_Sieve_Action_Keep(),
                                       new Ingo_Script_Sieve_Action_Stop()));
@@ -254,7 +241,7 @@ class Ingo_Script_Sieve extends Ingo_Script
             }
         }
 
-        $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Forwards")));
+        $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Forwards"));
 
         $test = new Ingo_Script_Sieve_Test_True();
         $if = new Ingo_Script_Sieve_If($test);
@@ -291,7 +278,7 @@ class Ingo_Script_Sieve extends Ingo_Script
 
         $action[] = new Ingo_Script_Sieve_Action_Stop();
 
-        $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Blacklisted Addresses")));
+        $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Blacklisted Addresses"));
 
         /* Split the test up to only do 5 addresses at a time. */
         $temp = array();
@@ -351,7 +338,7 @@ class Ingo_Script_Sieve extends Ingo_Script
             return;
         }
 
-        $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Whitelisted Addresses")));
+        $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Whitelisted Addresses"));
 
         $action = array(new Ingo_Script_Sieve_Action_Keep(), new Ingo_Script_Sieve_Action_Stop());
         $test = new Ingo_Script_Sieve_Test_Address(array('headers' => "From\nSender\nResent-From", 'addresses' => implode("\n", $wl_addr)));
@@ -376,7 +363,7 @@ class Ingo_Script_Sieve extends Ingo_Script
         }
 
         $vals = array(
-            'subject' => $this->encode($vacation->getVacationSubject()),
+            'subject' => $vacation->getVacationSubject(),
             'days' => $vacation->getVacationDays(),
             'addresses' => $vacation_addr,
             'start' => $vacation->getVacationStart(),
@@ -387,7 +374,7 @@ class Ingo_Script_Sieve extends Ingo_Script
             'end_year' => $vacation->getVacationEndYear(),
             'end_month' => $vacation->getVacationEndMonth(),
             'end_day' => $vacation->getVacationEndDay(),
-            'reason' => $this->encode($vacation->getVacationReason()),
+            'reason' => $vacation->getVacationReason(),
         );
 
         $action = $tests = array();
@@ -426,7 +413,7 @@ class Ingo_Script_Sieve extends Ingo_Script
             $tests[] = new Ingo_Script_Sieve_Test_Not($tmp);
         }
 
-        $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Vacation")));
+        $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Vacation"));
 
         if ($tests) {
             $test = new Ingo_Script_Sieve_Test_Allof($tests);
@@ -452,7 +439,7 @@ class Ingo_Script_Sieve extends Ingo_Script
             return;
         }
 
-        $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode(_("Spam Filter")));
+        $this->_blocks[] = new Ingo_Script_Sieve_Comment(_("Spam Filter"));
 
         $actions = array();
         $actions[] = new Ingo_Script_Sieve_Action_Fileinto(array_merge($this->_params, array('folder' => $spam->getSpamFolder())));
@@ -596,7 +583,7 @@ class Ingo_Script_Sieve extends Ingo_Script
                 continue 2;
             }
 
-            $this->_blocks[] = new Ingo_Script_Sieve_Comment($this->encode($filter['name']));
+            $this->_blocks[] = new Ingo_Script_Sieve_Comment($filter['name']);
 
             if ($filter['stop']) {
                 $action[] = new Ingo_Script_Sieve_Action_Stop();
index 434e56b..f3c464f 100644 (file)
@@ -272,11 +272,11 @@ class Ingo_Storage_Sql extends Ingo_Storage
             $values = array(
                 implode("\n", $ob->getVacationAddresses()),
                 Horde_String::convertCharset($ob->getVacationSubject(),
-                                       'UTF-8',
-                                       $this->_params['charset']),
+                                             'UTF-8',
+                                             $this->_params['charset']),
                 Horde_String::convertCharset($ob->getVacationReason(),
-                                       'UTF-8',
-                                       $this->_params['charset']),
+                                             'UTF-8',
+                                             $this->_params['charset']),
                 (int)$ob->getVacationDays(),
                 (int)$ob->getVacationStart(),
                 (int)$ob->getVacationEnd(),
index 735cde1..ddab9a0 100644 (file)
@@ -28,7 +28,6 @@ class Ingo_MaildropTest extends Ingo_TestBase {
         $GLOBALS['ingo_script'] = Ingo_Script::factory(
             'maildrop',
             array('path_style' => 'mbox',
-                  'charset' => 'UTF-8',
                   'spam_compare' => 'string',
                   'spam_header' => 'X-Spam-Level',
                   'spam_char' => '*'));
index c4639a9..e27e2d2 100644 (file)
@@ -31,7 +31,6 @@ class Ingo_ProcmailTest extends Ingo_TestBase {
         $GLOBALS['ingo_script'] = Ingo_Script::factory(
             'procmail',
             array('path_style' => 'mbox',
-                  'charset' => 'UTF-8',
                   'spam_compare' => 'string',
                   'spam_header' => 'X-Spam-Level',
                   'spam_char' => '*'));
index ab05794..6006d61 100644 (file)
@@ -154,7 +154,6 @@ class ScriptTester_imap extends ScriptTester {
         $GLOBALS['notification'] = new Ingo_Test_Notification;
 
         $params = array('api' => $this->api,
-                        'charset' => 'UTF-8',
                         'spam_compare' => 'string',
                         'spam_header' => 'X-Spam-Level',
                         'spam_char' => '*');
@@ -312,7 +311,6 @@ class ScriptTester_sieve extends ScriptTester {
     {
         $params = array('date_format' => '%x',
                         'time_format' => '%R',
-                        'charset' => 'UTF-8',
                         'spam_compare' => 'string',
                         'spam_header' => 'X-Spam-Level',
                         'spam_char' => '*');
index 856c396..fc89aa4 100644 (file)
@@ -30,8 +30,7 @@ class Ingo_SieveTest extends Ingo_TestBase {
                   'maxwhitelist' => 3));
         $GLOBALS['ingo_script'] = Ingo_Script::factory(
             'sieve',
-            array('charset' => 'UTF-8',
-                  'spam_compare' => 'string',
+            array('spam_compare' => 'string',
                   'spam_header' => 'X-Spam-Level',
                   'spam_char' => '*',
                   'date_format' => '%x',
index b7be022..5d7f95f 100644 (file)
@@ -20,7 +20,7 @@ if (!$perms->hasAppPermission('allow_rules')) {
     try {
         $message = Horde::callHook('perms_denied', array('ingo:allow_rules'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(_("You are not allowed to create or edit custom rules."));
     }
     $notification->push($message, 'horde.error', array('content.raw'));
     Horde::url('filters.php', true)->redirect();
@@ -171,7 +171,7 @@ default:
             try {
                 $message = Horde::callHook('perms_denied', array('ingo:max_rules'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), $perms->hasAppPermission('max_rules')));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             header('Location: ' . Horde::url('filters.php', true));
index 0580182..601867f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 $page_title = $GLOBALS['registry']->get('name');
index 129de55..aa45e47 100644 (file)
@@ -18,7 +18,7 @@
 <table width="100%" cellspacing="0">
   <tr class="control">
     <td>
-      <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, 'UTF-8') : '' ?>" />
+      <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? htmlspecialchars($rule['name']) : '' ?>" />
     </td>
     <td width="40" class="rightAlign">
       <?php echo Horde_Help::link('ingo', 'rule-name') ?>&nbsp;
index 4c9a507..cab2d71 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 01bd5d8..11fc7b5 100644 (file)
@@ -65,22 +65,21 @@ try {
 
 // Build the template (@TODO: Use Horde_View)
 $template = new Horde_Template();
-$template->set('charset', 'UTF-8');
 $template->set('jonah', 'Jonah ' . $registry->getVersion() . ' (http://www.horde.org/jonah/)');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 if (!empty($criteria['tag_id'])) {
-    $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')));
+    $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, htmlspecialchars($channel['channel_name'])));
 } else {
-    $template->set('channel_name', @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8'));
+    $template->set('channel_name', htmlspecialchars($channel['channel_name']));
 }
-$template->set('channel_desc', @htmlspecialchars($channel['channel_desc'], ENT_COMPAT, 'UTF-8'));
+$template->set('channel_desc', htmlspecialchars($channel['channel_desc']));
 $template->set('channel_updated', htmlspecialchars(date('r', $channel['channel_updated'])));
 $template->set('channel_official', htmlspecialchars($channel['channel_official']));
 $template->set('channel_rss', htmlspecialchars(Horde_Util::addParameter(Horde::url('delivery/rss.php', true, -1), array('type' => 'rss', 'channel_id' => $channel['channel_id']))));
 $template->set('channel_rss2', htmlspecialchars(Horde_Util::addParameter(Horde::url('delivery/rss.php', true, -1), array('type' => 'rss2', 'channel_id' => $channel['channel_id']))));
 foreach ($stories as &$story) {
-    $story['title'] = @htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8');
-    $story['description'] = @htmlspecialchars($story['description'], ENT_COMPAT, 'UTF-8');
+    $story['title'] = htmlspecialchars($story['title']);
+    $story['description'] = htmlspecialchars($story['description']);
     $story['permalink'] = htmlspecialchars($story['permalink']);
     $story['published'] = htmlspecialchars(date('r', $story['published']));
     if (!empty($story['body_type']) && $story['body_type'] == 'text') {
index cd1b19c..5365987 100644 (file)
@@ -56,13 +56,13 @@ class Horde_Block_Jonah_latest extends Horde_Block
         try {
             $story = $this->_fetch();
         } catch (Exception $e) {
-            return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+            return htmlspecialchars($e->getMessage());
         }
 
         return '<span class="storyDate">'
-               . @htmlspecialchars($story['updated_date'], ENT_COMPAT, 'UTF-8')
+               . htmlspecialchars($story['updated_date'])
                . '</span> '
-               . @htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8');
+               . htmlspecialchars($story['title']);
     }
 
     /**
index 4aa0962..0b66563 100644 (file)
@@ -59,15 +59,15 @@ class Horde_Block_Jonah_news extends Horde_Block {
         try {
             $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($this->_params['source']);
         } catch (Jonah_Exception $e) {
-            return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+            return htmlspecialchars($e->getMessage());
         }
 
         if (!empty($channel['channel_link'])) {
             $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank')
-                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')
+                . htmlspecialchars($channel['channel_name'])
                 . '</a>';
         } else {
-            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8');
+            $title = htmlspecialchars($channel['channel_name']);
         }
 
         return $title;
index 40cfbbd..26c8776 100644 (file)
@@ -56,15 +56,15 @@ class Horde_Block_Jonah_news_popular extends Horde_Block {
         try {
             $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($this->_params['source']);
         } catch (Exception $e) {
-            return @htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+            return htmlspecialchars($e->getMessage());
         }
 
         if (!empty($channel['channel_link'])) {
             $title = Horde::link(htmlspecialchars($channel['channel_link']), '', '', '_blank')
-                . @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')
+                . htmlspecialchars($channel['channel_name'])
                 . _(" - Most read stories") . '</a>';
         } else {
-            $title = @htmlspecialchars($channel['channel_name'], ENT_COMPAT, 'UTF-8')
+            $title = htmlspecialchars($channel['channel_name'])
                 . _(" - Most read stories");
         }
 
index d5d32c5..461f089 100644 (file)
@@ -57,12 +57,12 @@ class Horde_Block_Jonah_story extends Horde_Block {
         try {
             $story = $this->_fetch();
         } catch (Jonah_Exception $e) {
-            return htmlspecialchars($e->getMessage(), ENT_COMPAT, 'UTF-8');
+            return htmlspecialchars($e->getMessage());
         }
         return '<span class="storyDate">'
-                . htmlspecialchars($story['updated_date'], ENT_COMPAT,'UTF-8')
+                . htmlspecialchars($story['updated_date'])
                 . '</span> '
-                . htmlspecialchars($story['title'], ENT_COMPAT, 'UTF-8');
+                . htmlspecialchars($story['title']);
     }
 
     /**
index dd26f7d..22049be 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 1a7d8d1..ea8965e 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 9735801..4257c1b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 0baa4af..ff75592 100644 (file)
@@ -125,7 +125,6 @@ $nls['charsets']['bg_BG'] = 'windows-1251';
 $nls['charsets']['bs_BA'] = 'ISO-8859-2';
 $nls['charsets']['cs_CZ'] = 'ISO-8859-2';
 $nls['charsets']['el_GR'] = 'ISO-8859-7';
-$nls['charsets']['eu_ES'] = 'UTF-8';
 $nls['charsets']['fa_IR'] = 'UTF-8';
 $nls['charsets']['he_IL'] = 'UTF-8';
 $nls['charsets']['hu_HU'] = 'ISO-8859-2';
index 017e2a7..4a871de 100644 (file)
@@ -1,8 +1,3 @@
-/*
-  Local variables:
-  buffer-file-coding-system: utf-8
-  End:
-*/
 body {
   color: black;
   background-color: #F8FCF8;
index 05ad79e..41907c6 100644 (file)
@@ -54,7 +54,7 @@ do {
             try {
                 $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
             }
             $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
             break;
index 5b54759..c157483 100644 (file)
@@ -46,7 +46,7 @@ if ($perms->hasAppPermission('max_events') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
     }
     $notification->push($message, 'horde.warning', array('content.raw'));
     $templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/export.inc');
@@ -182,7 +182,7 @@ case 'export':
             $calNames[] = $share->get('name');
         }
 
-        $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), 'UTF-8', 'utf-8'));
+        $iCal->setAttribute('X-WR-CALNAME', implode(', ', $calNames)));
         $data = $iCal->exportvCalendar();
         $browser->downloadHeaders(_("events.ics"), 'text/calendar', false, strlen($data));
         echo $data;
@@ -264,7 +264,7 @@ if (is_array($next_step)) {
             try {
                 $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break;
@@ -340,7 +340,7 @@ if (is_array($next_step)) {
 if (Horde_Util::getFormData('import_ajax')) {
     $stack = $notification->notify(array('listeners' => 'status', 'raw' => true));
     if ($stack) {
-        Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON, 'UTF-8') . '));');
+        Horde::addInlineScript('window.parent.KronolithCore.showNotifications(window.parent.$A(' . Horde_Serialize::serialize($stack, Horde_Serialize::JSON) . '));');
     }
     Horde::addInlineScript('window.parent.$(window.name).remove();');
     Horde::outputInlineScript();
index c32e76d..cf3f2f0 100644 (file)
@@ -31,7 +31,7 @@ function _check_max()
         try {
             $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+            $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
         }
         $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
         return false;
index fcb499e..259827c 100644 (file)
@@ -91,17 +91,16 @@ $history = $injector->getInstance('Horde_History');
 $now = new Horde_Date(time());
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', 'UTF-8');
 $template->set('updated', $now->format(DATE_ATOM));
 $template->set('kronolith_name', 'Kronolith');
 $template->set('kronolith_version', $registry->getVersion());
 $template->set('kronolith_uri', 'http://www.horde.org/kronolith/');
 $template->set('kronolith_icon', Horde::url(Horde_Themes::img('kronolith.png'), true, -1));
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
-$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, 'UTF-8'));
-$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, 'UTF-8'), true);
-$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, 'UTF-8'));
-$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, 'UTF-8'), true);
+$template->set('calendar_name', htmlspecialchars($share->get('name')));
+$template->set('calendar_desc', htmlspecialchars($share->get('desc')), true);
+$template->set('calendar_owner', htmlspecialchars($identity->getValue('fullname')));
+$template->set('calendar_email', htmlspecialchars($identity->getValue('from_addr')), true);
 $template->set('self_url', $self_url);
 
 $twentyFour = $prefs->getValue('twentyFor');
@@ -117,7 +116,7 @@ foreach ($events as $day_events) {
         }
         $modified = new Horde_Date($modified);
         /* Description. */
-        $desc = @htmlspecialchars($event->description, ENT_COMPAT, 'UTF-8');
+        $desc = htmlspecialchars($event->description);
         if (strlen($desc)) {
             $desc .= '<br /><br />';
         }
@@ -134,15 +133,15 @@ foreach ($events as $day_events) {
             $attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>'));
         }
         if (count($attendees)) {
-            $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, 'UTF-8');
+            $desc .= '<br />' . _("Who:") . ' ' . htmlspecialchars(implode(', ', $attendees));
         }
         if (strlen($event->location)) {
-            $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->location, ENT_COMPAT, 'UTF-8');
+            $desc .= '<br />' . _("Where:") . ' ' . htmlspecialchars($event->location);
         }
         $desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->status);
 
-        $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, 'UTF-8');
-        $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, 'UTF-8');
+        $entries[$id]['title'] = htmlspecialchars($event->getTitle());
+        $entries[$id]['desc'] = htmlspecialchars($desc);
         $entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1));
         $entries[$id]['modified'] = $modified->format(DATE_ATOM);
     }
index 7b075dd..73fa82e 100644 (file)
@@ -100,7 +100,7 @@ class Kronolith_Ajax_Application extends Horde_Core_Ajax_Application
                 try {
                     $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
                 } catch (Horde_Exception_HookNotSet $e) {
-                    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+                    $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
                 }
                 $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
                 return $result;
index 2a5245f..c99d6ab 100644 (file)
@@ -785,7 +785,7 @@ class Kronolith_Api extends Horde_Registry_Api
             $share = $kronolith_shares->getShare($event->calendar);
 
             $iCal = new Horde_Icalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', $share->get('name'));
 
             // Create a new vEvent.
             $iCal->addComponent($event->toiCalendar($iCal));
@@ -835,9 +835,9 @@ class Kronolith_Api extends Horde_Registry_Api
             $share = $kronolith_shares->getShare($calendar);
 
             $iCal = new Horde_Icalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'UTF-8'));
+            $iCal->setAttribute('X-WR-CALNAME', $share->get('name'));
             if (strlen($share->get('desc'))) {
-                $iCal->setAttribute('X-WR-CALDESC', Horde_String::convertCharset($share->get('desc'), 'UTF-8', 'UTF-8'));
+                $iCal->setAttribute('X-WR-CALDESC', $share->get('desc'));
             }
 
             foreach ($events as $dayevents) {
index d84ca63..d26a0bb 100644 (file)
@@ -523,7 +523,7 @@ class Kronolith_Application extends Horde_Registry_Application
                     $tree->addNode(
                         $parent . $calId . $event->id,
                         $parent,
-                        htmlspecialchars($event->getTitle(), ENT_COMPAT, 'UTF-8'),
+                        htmlspecialchars($event->getTitle()),
                         1,
                         false,
                         array(
index 4aa4d89..e6e0a83 100644 (file)
@@ -560,17 +560,14 @@ abstract class Kronolith_Event
             $vEvent->setAttribute('LAST-MODIFIED', $modified);
         }
 
-        $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), 'UTF-8', 'utf-8'));
+        $vEvent->setAttribute('SUMMARY', $this->getTitle());
         $name = Kronolith::getUserName($this->creator);
-        if (!$v1) {
-            $name = Horde_String::convertCharset($name, 'UTF-8', 'utf-8');
-        }
         $vEvent->setAttribute('ORGANIZER',
                               'mailto:' . Kronolith::getUserEmail($this->creator),
                               array('CN' => $name));
         if (!$this->private || $this->creator == $GLOBALS['registry']->getAuth()) {
             if (!empty($this->description)) {
-                $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, 'UTF-8', 'utf-8'));
+                $vEvent->setAttribute('DESCRIPTION', $this->description);
             }
 
             // Tags
@@ -579,12 +576,12 @@ abstract class Kronolith_Event
                 $tags = implode(', ', $tags);
             }
             if (!empty($tags)) {
-                $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, 'UTF-8', 'utf-8'));
+                $vEvent->setAttribute('CATEGORIES', $tags);
             }
 
             // Location
             if (!empty($this->location)) {
-                $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, 'UTF-8', 'utf-8'));
+                $vEvent->setAttribute('LOCATION', $this->location);
             }
             if ($this->geoLocation) {
                 $vEvent->setAttribute('GEO', array('latitude' => $this->geoLocation['lat'], 'longitude' => $this->geoLocation['lon']));
@@ -702,7 +699,7 @@ abstract class Kronolith_Event
                 }
             } else {
                 if (!empty($status['name'])) {
-                    $params['CN'] = Horde_String::convertCharset($status['name'], 'UTF-8', 'utf-8');
+                    $params['CN'] = $status['name'];
                 }
                 if (!empty($email)) {
                     $email = 'mailto:' . $email;
@@ -1104,19 +1101,17 @@ abstract class Kronolith_Event
      */
     public function fromASAppointment(Horde_ActiveSync_Message_Appointment $message)
     {
-        $charset = 'UTF-8';
-
         /* New event? */
         if ($this->id === null) {
             $this->creator = $GLOBALS['registry']->getAuth();
         }
-        if ($title = Horde_String::convertCharset($message->getSubject(), 'utf-8', $charset)) {
+        if (strlen($title = $message->getSubject())) {
             $this->title = $title;
         }
-        if ($description = Horde_String::convertCharset($message->getBody(), 'utf-8', $charset)) {
+        if (strlen($description = $message->getBody())) {
             $this->description = $description;
         }
-        if ($location = Horde_String::convertCharset($message->getLocation(), 'utf-8', $charset)) {
+        if (strlen($location = $message->getLocation())) {
             $this->location = $location;
         }
 
@@ -1190,8 +1185,8 @@ abstract class Kronolith_Event
                     $event->start = $times['start'];
                     $event->end = $times['end'];
                     $event->allday = $times['allday'];
-                    $event->title = Horde_String::convertCharset($rule->getSubject(), 'utf-8', $charset);
-                    $event->description = Horde_String::convertCharset($rule->getBody(), 'utf-8', $charset);
+                    $event->title = $rule->getSubject();
+                    $event->description = $rule->getBody();
                     $event->baseid = $this->uid;
                     $event->exceptionoriginaldate = $original;
                     $event->initialized = true;
@@ -1208,16 +1203,16 @@ abstract class Kronolith_Event
         $attendees = $message->getAttendees();
         foreach ($attendees as $attendee) {
             // TODO: participation and response are not supported in AS <= 2.5
-            $this->addAttendee(Horde_String::convertCharset($attendee->email, 'utf-8', $charset),
+            $this->addAttendee($attendee->email,
                                Kronolith::PART_NONE,
                                Kronolith::RESPONSE_NONE,
-                               Horde_String::convertCharset($attendee->name, 'utf-8', $charset));
+                               $attendee->name);
         }
 
         /* Categories (Tags) */
         $tags = $message->getCategories();
         foreach ($tags as $tag) {
-            $this->tags[] = Horde_String::convertCharset($tag, 'utf-8', $charset);
+            $this->tags[] = $tag;
         }
 
         /* Flag that we are initialized */
@@ -1231,12 +1226,10 @@ abstract class Kronolith_Event
      */
     public function toASAppointment()
     {
-        $charset = 'UTF-8';
-
         $message = new Horde_ActiveSync_Message_Appointment(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger')));
-        $message->setSubject(Horde_String::convertCharset($this->getTitle(), $charset, 'utf-8'));
-        $message->setBody(Horde_String::convertCharset($this->description, $charset, 'utf-8'));
-        $message->setLocation(Horde_String::convertCharset($this->location, $charset, 'utf-8'));
+        $message->setSubject($this->getTitle());
+        $message->setBody($this->description);
+        $message->setLocation($this->location);
 
         /* Start and End */
         $message->setDatetime(array('start' => $this->start,
@@ -1247,10 +1240,10 @@ abstract class Kronolith_Event
         $message->setTimezone($this->start);
 
         /* Organizer */
-        $name = Horde_String::convertCharset(Kronolith::getUserName($this->creator), $charset, 'utf-8');
+        $name = Kronolith::getUserName($this->creator);
         $message->setOrganizer(
                 array('name' => $name,
-                      'email' => Horde_String::convertCharset(Kronolith::getUserEmail($this->creator), $charset, 'utf-8'))
+                      'email' => Kronolith::getUserEmail($this->creator))
         );
 
         /* Privacy */
@@ -1312,9 +1305,9 @@ abstract class Kronolith_Event
                         }
 
                         /* Remaining properties that could be different */
-                        $e->setSubject(Horde_String::convertCharset($exception->getTitle(), $charset, 'utf-8'));
-                        $e->setLocation(Horde_String::convertCharset($exception->location, $charset, 'utf-8'));
-                        $e->setBody(Horde_String::convertCharset($exception->description, $charset, 'utf-8'));
+                        $e->setSubject($exception->getTitle());
+                        $e->setLocation($exception->location);
+                        $e->setBody($exception->description);
 
                         $e->setSensitivity($exception->private ?
                             Horde_ActiveSync_Message_Appointment::SENSITIVITY_PRIVATE :
@@ -1340,7 +1333,7 @@ abstract class Kronolith_Event
 
                         /* Tags/Categories */
                         foreach ($exception->tags as $tag) {
-                            $e->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8'));
+                            $e->addCategory($tag);
                         }
                         $message->addexception($e);
 
@@ -1362,7 +1355,7 @@ abstract class Kronolith_Event
             $message->setMeetingStatus(Horde_ActiveSync_Message_Appointment::MEETING_IS_MEETING);
             foreach ($this->attendees as $email => $properties) {
                 $attendee = new Horde_ActiveSync_Message_Attendee();
-                $attendee->email = Horde_String::convertCharset($email, $charset, 'utf-8');
+                $attendee->email = $email;
                 // AS only as required or opitonal
                 //$attendee->type = ($properties['attendance'] !== Kronolith::PART_REQUIRED ? Kronolith::PART_OPTIONAL : Kronolith::PART_REQUIRED);
                 //$attendee->status = $properties['response'];
@@ -1387,7 +1380,7 @@ abstract class Kronolith_Event
 
         /* Categories (tags) */
         foreach ($this->tags as $tag) {
-            $message->addCategory(Horde_String::convertCharset($tag, $charset, 'utf-8'));
+            $message->addCategory($tag);
         }
 
         return $message;
@@ -2023,7 +2016,7 @@ abstract class Kronolith_Event
                         // Convert IDN hosts to ASCII.
                         if (function_exists('idn_to_ascii')) {
                             $old_error = error_reporting(0);
-                            $url['host'] = idn_to_ascii(Horde_String::convertCharset($url['host'], 'UTF-8', 'UTF-8'));
+                            $url['host'] = idn_to_ascii($url['host']);
                             error_reporting($old_error);
                         } elseif (Horde_Mime::is8bit($url['host'])) {
                             //throw new Kronolith_Exception(_("Invalid character in URL."));
@@ -2639,7 +2632,7 @@ abstract class Kronolith_Event
                                        '',
                                        array('style' => $this->getCSSColors(false)));
         }
-        $link .= @htmlspecialchars($event_title, ENT_QUOTES, 'UTF-8');
+        $link .= htmlspecialchars($event_title);
         if ($read_permission && $view_url) {
             $link .= '</a>';
         }
index c589e21..852b5b1 100644 (file)
@@ -42,7 +42,7 @@ class Kronolith_Event_Holidays extends Kronolith_Event
     {
         $this->stored = true;
         $this->initialized = true;
-        $this->title = Horde_String::convertCharset($dhEvent->getTitle(), 'UTF-8');
+        $this->title = $dhEvent->getTitle()
         $this->start = new Horde_Date($dhEvent->_date->getTime());
         $this->end = new Horde_Date($this->start);
         $this->end->mday++;
index 1feb149..31ee396 100644 (file)
@@ -194,13 +194,11 @@ class Kronolith_FreeBusy
                 $contentType = $http->getResponseHeader('Content-Type');
                 if ($contentType && strpos($contentType, ';') !== false) {
                     list(,$charset,) = explode(';', $contentType);
-                    $charset = trim(str_replace('charset=', '', $charset));
-                } else {
-                    $charset = 'UTF-8';
+                    $data = Horde_String::convertCharset($data, trim(str_replace('charset=', '', $charset)), 'UTF-8');
                 }
 
                 $vCal = new Horde_Icalendar();
-                $vCal->parsevCalendar($data, 'VCALENDAR', $charset);
+                $vCal->parsevCalendar($data, 'VCALENDAR');
                 $components = $vCal->getComponents();
 
                 $vCal = new Horde_Icalendar();
index b62a3e5..9630e05 100644 (file)
@@ -79,7 +79,7 @@ class Kronolith
         Horde_Core_Ui_JsCalendar::init(array('short_weekdays' => true));
 
         if (isset($GLOBALS['language'])) {
-            header('Content-type: text/html; charset=' . 'UTF-8');
+            header('Content-type: text/html; charset=UTF-8');
             header('Vary: Accept-Language');
         }
 
@@ -333,7 +333,7 @@ class Kronolith
         // Maps
         $code['conf']['maps'] = $GLOBALS['conf']['maps'];
 
-        return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, 'UTF-8') . ';');
+        return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON) . ';');
     }
 
     /**
@@ -2316,7 +2316,7 @@ class Kronolith
             /* Build the iCalendar data */
             $iCal = new Horde_Icalendar();
             $iCal->setAttribute('METHOD', $method);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', $share->get('name'));
             $vevent = $event->toiCalendar($iCal);
             if ($action == self::ITIP_CANCEL && !empty($instance)) {
                 // Recurring event instance deletion, need to specify the
index 856986a..cd64e46 100644 (file)
@@ -27,11 +27,7 @@ class Kronolith_View_ExportEvent {
         if ($event->calendarType == 'internal') {
             try {
                 $share = $GLOBALS['kronolith_shares']->getShare($event->calendar);
-                $iCal->setAttribute(
-                    'X-WR-CALNAME',
-                    Horde_String::convertCharset($share->get('name'),
-                                                 'UTF-8',
-                                                 'utf-8'));
+                $iCal->setAttribute('X-WR-CALNAME', $share->get('name'));
             } catch (Exception $e) {
             }
         }
@@ -41,7 +37,7 @@ class Kronolith_View_ExportEvent {
 
         $GLOBALS['browser']->downloadHeaders(
             $event->getTitle() . '.ics',
-            'text/calendar; charset=' . 'UTF-8',
+            'text/calendar; charset=UTF-8',
             true, strlen($content));
         echo $content;
         exit;
index a8aaf70..dd21a86 100644 (file)
@@ -26,7 +26,7 @@ if ($perms->hasAppPermission('max_events') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('kronolith:max_events'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
     }
     $notification->push($message, 'horde.error', array('content.raw'));
     $url->redirect();
index 168fef5..a7993c3 100644 (file)
@@ -5,7 +5,7 @@ Horde::addScriptFile('views.js', 'kronolith');
 Horde::addScriptFile('stripe.js', 'horde');
 
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index ae86648..b20c19d 100644 (file)
@@ -3,7 +3,6 @@
  * JavaScript variables for the traditional interface.
  */
 
-$charset = 'UTF-8';
 $currentDate = Kronolith::currentDate();
 
 /* Variables used in core javascript files. */
@@ -25,7 +24,7 @@ $gettext = array(
 ?>
 <script type="text/javascript">//<![CDATA[
 var KronolithDate = new Date(<?php printf('%d, %d, %d', $currentDate->year, $currentDate->month - 1, $currentDate->mday) ?>);
-var KronolithText = <?php echo Horde_Serialize::serialize($gettext, Horde_Serialize::JSON, $charset) ?>;
-var KronolithVar = <?php echo Horde_Serialize::serialize($var, Horde_Serialize::JSON, $charset) ?>;
+var KronolithText = <?php echo Horde_Serialize::serialize($gettext, Horde_Serialize::JSON) ?>;
+var KronolithVar = <?php echo Horde_Serialize::serialize($var, Horde_Serialize::JSON) ?>;
 var KronolithView = '<?php if (isset($view) && is_object($view)) echo $view->getName() ?>';
 //]]></script>
index 5d2a308..500c044 100644 (file)
@@ -26,7 +26,7 @@
 <!-- owner -->
 <tr>
  <td class="rightAlign"><strong><?php echo _("Owner") ?>&nbsp;&nbsp;</strong></td>
- <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, 'UTF-8') ?> </td>
+ <td><?php echo htmlspecialchars($owner) ?> </td>
 </tr>
 <?php endif; ?>
 
@@ -74,14 +74,14 @@ if ($this->event->initialized && $this->event->alarm > 0):
 <?php if (isset($created)): ?>
 <tr>
   <td class="nowrap rightAlign"><strong><?php echo _("Created") ?></strong>&nbsp;&nbsp;</td>
-  <td class="nowrap"><?php  echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?></td>
+  <td class="nowrap"><?php  echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . htmlspecialchars($createdby) ?></td>
 </tr>
 <?php endif; ?>
 
 <?php if (isset($modified)): ?>
 <tr>
   <td class="nowrap rightAlign"><strong><?php echo _("Last Modified") ?></strong>&nbsp;&nbsp;</td>
-  <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?></td>
+  <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . htmlspecialchars($modifiedby) ?></td>
 </tr>
 <?php endif; ?>
 
index 83626c7..1e62a82 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 88ed5e8..d63fa48 100644 (file)
@@ -34,7 +34,7 @@ $templates = array(
 );
 if ($GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true &&
     $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8');
+    $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')));
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
     }
@@ -121,7 +121,7 @@ if (is_array($next_step)) {
     $num_memos = Mnemo::countMemos();
     foreach ($next_step as $row) {
         if ($max_memos !== true && $num_memos >= $max_memos) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8');
+            $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes')));
             if (!empty($conf['hooks']['permsdenied'])) {
                 $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
             }
index 310b43a..f1185f4 100644 (file)
@@ -72,7 +72,7 @@ case 'add_memo':
     /* Check permissions. */
     if ($injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') !== true &&
         $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') <= Mnemo::countMemos()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d notes."), $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes')));
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('mnemo:max_notes'), 'horde', $message);
         }
index a329b56..80159ce 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index afb9e4b..e585a34 100644 (file)
@@ -41,7 +41,7 @@ if ($perms->hasAppPermission('max_tasks') !== true &&
     try {
         $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
     } catch (Horde_Exception_HookNotSet $e) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')));
     }
     $notification->push($message, 'horde.warning', array('content.raw'));
     $templates[Horde_Data::IMPORT_FILE] = array(NAG_TEMPLATES . '/data/export.inc');
@@ -169,7 +169,7 @@ if (is_array($next_step)) {
             try {
                 $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             break;
index 02e1872..5198d94 100644 (file)
@@ -1060,7 +1060,7 @@ class Nag_Api extends Horde_Registry_Api
             $share = $GLOBALS['nag_shares']->getShare($tasklist);
 
             $iCal = new Horde_iCalendar($version);
-            $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 'UTF-8', 'utf-8'));
+            $iCal->setAttribute('X-WR-CALNAME', $share->get('name'));
 
             $tasks->reset();
             while ($task = $tasks->each()) {
index b76b9f4..f190e54 100644 (file)
@@ -46,7 +46,7 @@ class Nag_TaskForm extends Horde_Form {
             if ($vars->get('task_id') == $task->id) {
                 continue;
             }
-            $task_enums[htmlspecialchars($task->id)] = str_repeat('&nbsp;', $task->indent * 4) . htmlentities($task->name, ENT_COMPAT, 'UTF-8');
+            $task_enums[htmlspecialchars($task->id)] = str_repeat('&nbsp;', $task->indent * 4) . htmlentities($task->name);
         }
         $users = array();
         $share = $GLOBALS['nag_shares']->getShare($tasklist);
index c6117dc..d9bd320 100644 (file)
@@ -672,12 +672,11 @@ class Nag
             return Horde::link($GLOBALS['registry']->call(
                                    'mail/compose',
                                    array(array('to' => $email))))
-                . @htmlspecialchars($fullname . ' <' . $email . '>',
-                                    ENT_COMPAT, 'UTF-8')
+                . htmlspecialchars($fullname . ' <' . $email . '>')
                 . '</a>';
         }
 
-        return @htmlspecialchars($fullname, ENT_COMPAT, 'UTF-8');
+        return htmlspecialchars($fullname);
     }
 
     /**
index 01c84b1..f6bb612 100644 (file)
@@ -800,11 +800,11 @@ class Nag_Task {
         }
 
         if (!empty($this->name)) {
-            $vTodo->setAttribute('SUMMARY', $v1 ? $this->name : Horde_String::convertCharset($this->name, 'UTF-8', 'utf-8'));
+            $vTodo->setAttribute('SUMMARY', $this->name);
         }
 
         if (!empty($this->desc)) {
-            $vTodo->setAttribute('DESCRIPTION', $v1 ? $this->desc : Horde_String::convertCharset($this->desc, 'UTF-8', 'utf-8'));
+            $vTodo->setAttribute('DESCRIPTION', $this->desc);
         }
 
         if (isset($this->priority)) {
@@ -850,7 +850,7 @@ class Nag_Task {
         }
 
         if (!empty($this->category)) {
-            $vTodo->setAttribute('CATEGORIES', $v1 ? $this->category : Horde_String::convertCharset($this->category, 'UTF-8', 'utf-8'));
+            $vTodo->setAttribute('CATEGORIES', $this->category);
         }
 
         /* Get the task's history. */
@@ -891,8 +891,8 @@ class Nag_Task {
         $message = new Horde_ActiveSync_Message_Task();
 
         /* Notes and Title */
-        $message->setBody(Horde_String::convertCharset($this->desc, 'UTF-8', 'utf-8'));
-        $message->setSubject(Horde_String::convertCharset($this->name, 'UTF-8', 'utf-8'));
+        $message->setBody($this->desc);
+        $message->setSubject($this->name);
 
         /* Completion */
         if ($this->completed) {
@@ -1043,8 +1043,8 @@ class Nag_Task {
     function fromASTask(Horde_ActiveSync_Message_Task $message)
     {
         /* Notes and Title */
-        $this->desc = Horde_String::convertCharset($message->getBody(), 'utf-8', 'UTF-8');
-        $this->name = Horde_String::convertCharset($message->getSubject(), 'utf-8', 'UTF-8');
+        $this->desc = $message->getBody();
+        $this->name = $message->getSubject();
 
         /* Completion */
         if ($this->completed = $message->getComplete()) {
index 92e5334..f744430 100644 (file)
@@ -71,7 +71,7 @@ case 'add_task':
         try {
             $message = Horde::callHook('perms_denied', array('nag:max_tasks'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')), ENT_COMPAT, 'UTF-8');
+            $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d tasks."), $perms->hasAppPermission('max_tasks')));
         }
         $notification->push($message, 'horde.error', array('content.raw'));
         Horde::url('list.php', true)->redirect();
index 5d7a22d..7726b20 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 3eece03..36b610d 100644 (file)
 <?php if (isset($created)): ?>
  <tr>
   <td class="rightAlign"><strong><?php echo _("Created") ?></strong></td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, 'UTF-8') ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $created) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $created) . ' ' . htmlspecialchars($createdby) ?></td>
  </tr>
 <?php endif; ?>
 
 <?php if (isset($modified)): ?>
  <tr>
   <td class="rightAlign"><strong><?php echo _("Last Modified") ?></strong></td>
-  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, 'UTF-8') ?></td>
+  <td><?php echo strftime($prefs->getValue('date_format'), $modified) . ' ' . date($prefs->getValue('twentyFour') ? 'G:i' : 'g:i a', $modified) . ' ' . htmlspecialchars($modifiedby) ?></td>
  </tr>
 <?php endif; ?>
 
index d5fd9c9..91e2dc2 100644 (file)
@@ -54,7 +54,7 @@ $pdf->newLine(4);
 
 $pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n");
 $pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true));
-$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), 'UTF-8', 'UTF-8'));
+$pdf->multiCell(0, 12, strip_tags($row['content']));
 
 $browser->downloadHeaders($id . '.pdf', 'application/pdf');
 echo $pdf->getOutput();
index 3844b8f..57a65d5 100644 (file)
@@ -19,7 +19,7 @@ if (!$rss) {
     $list = News::getLastComments(50);
     $title = _("Last comments");
 
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
 <rss version="2.0">
 <channel>
     <title>' . htmlspecialchars($title) . '</title>
@@ -47,5 +47,5 @@ if (!$rss) {
     $cache->set($cache_key, $rss);
 }
 
-header('Content-type: text/xml; charset=' . 'UTF-8');
+header('Content-type: text/xml; charset=UTF-8');
 echo $rss;
index be6ba6c..8d091b5 100644 (file)
@@ -22,7 +22,7 @@ if (!$rss) {
     $title = $registry->get('name', 'horde');
 
     $read_url = Horde::url('read.php', true, -1);
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($title) . '</title>
index 5df939e..190dbbc 100755 (executable)
@@ -53,7 +53,7 @@ if (empty($rss)) {
     }
 
     // Wee need the last published news time
-    $rssheader = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rssheader = '<?xml version="1.0" encoding="UTF-8" ?>
 <rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
index 991f28d..7f186be 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 3d3d06c..d1bc89c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 90f306b..06da9aa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index a278cfa..edec293 100644 (file)
@@ -1,6 +1,6 @@
 <?php
      if (isset($language)) {
-         header('Content-type: text/html; charset=' . 'UTF-8');
+         header('Content-type: text/html; charset=UTF-8');
          header('Vary: Accept-Language');
      }
 ?>
index 216fef7..fbee5d1 100644 (file)
 var ajax_url = '<?php echo Horde::getServiceLink('ajax', 'shout') ?>';
 var curmenu = null;
 var menuInfo = $H();
-var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON, 'UTF-8'); ?>);
-var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON, 'UTF-8'); ?>);
-var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON, 'UTF-8'); ?>);
-var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON, 'UTF-8'); ?>);
+var menuActions = $H(<?php echo Horde_Serialize::serialize(Shout::getMenuActions(), Horde_Serialize::JSON); ?>);
+var destinations = $H(<?php echo Horde_Serialize::serialize($destinations, Horde_Serialize::JSON); ?>);
+var conferences = $H(<?php echo Horde_Serialize::serialize($conferences, Horde_Serialize::JSON); ?>);
+var recordings = $H(<?php echo Horde_Serialize::serialize($recordings, Horde_Serialize::JSON); ?>);
 
 function empty(p)
 {
index 90f306b..06da9aa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index df35f6c..ff18912 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 95a1b9d..1ba1f0b 100644 (file)
@@ -20,7 +20,7 @@ case 'add_bookmark':
     /* Check permissions. */
     if (Trean::hasPermission('max_bookmarks') !== true &&
         Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')));
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
         }
@@ -83,7 +83,7 @@ case 'add_folder':
     /* Check permissions. */
     if (Trean::hasPermission('max_folders') !== true &&
         Trean::hasPermission('max_folders') <= Trean::countFolders()) {
-        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8');
+        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')));
         if (!empty($conf['hooks']['permsdenied'])) {
             $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
         }
index 88a14ea..58f6837 100644 (file)
@@ -53,7 +53,7 @@ Horde_Registry::appInit('trean');
 $folders_exceeded = Trean::hasPermission('max_folders') !== true &&
 Trean::hasPermission('max_folders') <= Trean::countFolders();
 if ($folders_exceeded) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8');
+    $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')));
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
     }
@@ -62,7 +62,7 @@ if ($folders_exceeded) {
 $bookmarks_exceeded = Trean::hasPermission('max_bookmarks') !== true &&
 Trean::hasPermission('max_bookmarks') <= $trean_shares->countBookmarks();
 if ($bookmarks_exceeded) {
-    $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8');
+    $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')));
     if (!empty($conf['hooks']['permsdenied'])) {
         $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
     }
@@ -104,7 +104,7 @@ case 'import':
                 continue;
             }
             if ($max_folders !== true && $num_folders >= $max_folders) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), Trean::hasPermission('max_folders')));
                 if (!empty($conf['hooks']['permsdenied'])) {
                     $message = Horde::callHook('_perms_hook_denied', array('trean:max_folders'), 'horde', $message);
                 }
@@ -129,7 +129,7 @@ case 'import':
                              $line, $temp)) {
             /* A bookmark. */
             if ($max_bookmarks !== true && $num_bookmarks >= $max_bookmarks) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')));
                 if (!empty($conf['hooks']['permsdenied'])) {
                     $message = Horde::callHook('_perms_hook_denied', array('trean:max_bookmarks'), 'horde', $message);
                 }
index 929fd29..c10902f 100644 (file)
@@ -59,12 +59,12 @@ $cache = $GLOBALS['injector']->getInstance('Horde_Cache');
 $cache_key = 'trean_rss_' . Horde_Auth::getAuth() . '_' . ($folderId === null ? 'all' : $folderId);
 $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
 if (!$rss) {
-    $rss = '<?xml version="1.0" encoding="' . 'UTF-8' . '" ?>
+    $rss = '<?xml version="1.0" encoding="UTF-8" ?>
     <rss version="2.0">
         <channel>
         <title>' . htmlspecialchars($folderId == null ? $registry->get('name') : $folder->get('name')) . '</title>
         <language>' . $registry->preferredLang() . '</language>
-        <charset>' . 'UTF-8' . '</charset>
+        <charset>UTF-8</charset>
         <lastBuildDate>' . date('Y-m-d H:i:s') . '</lastBuildDate>
         <image>
             <url>http://' . $_SERVER['SERVER_NAME'] . $registry->get('webroot') . '/themes/graphics/favicon.ico</url>
index 2d302e1..27e515a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 8f2b375..ada57a7 100644 (file)
@@ -48,7 +48,7 @@ if ($source) {
             try {
                 $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
             } catch (Horde_Exception_HookNotSet $e) {
-                $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, 'UTF-8');
+                $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']));
             }
             $notification->push($message, 'horde.error', array('content.raw'));
             $url = $url
index 754ddf3..b146e7d 100644 (file)
@@ -349,7 +349,7 @@ case Horde_Data::IMPORT_FILE:
         try {
             $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
         } catch (Horde_Exception_HookNotSet $e) {
-            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title), ENT_COMPAT, 'UTF-8');
+            $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $driver->title));
         }
         $notification->push($message, 'horde.error', array('content.raw'));
         $error = true;
index e499993..7e23be2 100644 (file)
@@ -972,10 +972,6 @@ class Turba_Driver implements Countable
                 continue;
             }
 
-            if ($version != '2.1') {
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-            }
-
             switch ($key) {
             case 'name':
                 if ($fields && !isset($fields['FN'])) {
@@ -1641,10 +1637,6 @@ class Turba_Driver implements Countable
             Horde_Icalendar_Vcard::N_SUFFIX => isset($hash['nameSuffix']) ? $hash['nameSuffix'] : '',
         );
         $val = implode(';', $a);
-        if ($version != '2.1') {
-            $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-            $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8');
-        }
         if (!$fields || isset($fields['N'])) {
             $vcard->setAttribute('N', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $a);
         }
@@ -1658,9 +1650,6 @@ class Turba_Driver implements Countable
             } else {
                 $val = '';
             }
-            if ($version != '2.1') {
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-            }
             $vcard->setAttribute('FN', $val, Horde_Mime::is8bit($val) ? $charset : array());
         }
 
@@ -1675,10 +1664,6 @@ class Turba_Driver implements Countable
         }
         if (count($org) && (!$fields || isset($fields['ORG']))) {
             $val = implode(';', $org);
-            if ($version != '2.1') {
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-                $org = Horde_String::convertCharset($org, 'UTF-8', 'utf-8');
-            }
             $vcard->setAttribute('ORG', $val, Horde_Mime::is8bit($val) ? $charset : array(), false, $org);
         }
 
@@ -1733,8 +1718,6 @@ class Turba_Driver implements Countable
                 }
             } else {
                 $params = array('TYPE' => '');
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-                $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -1788,8 +1771,6 @@ class Turba_Driver implements Countable
                 }
             } else {
                 $params = array('TYPE' => 'HOME');
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-                $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -1843,8 +1824,6 @@ class Turba_Driver implements Countable
                 }
             } else {
                 $params = array('TYPE' => 'WORK');
-                $val = Horde_String::convertCharset($val, 'UTF-8', 'utf-8');
-                $a = Horde_String::convertCharset($a, 'UTF-8', 'utf-8');
             }
             $vcard->setAttribute('ADR', $val, $params, true, $a);
         }
@@ -2287,32 +2266,31 @@ class Turba_Driver implements Countable
     public function toASContact(Turba_Object $object)
     {
         $message = new Horde_ActiveSync_Message_Contact(array('logger' => $GLOBALS['injector']->getInstance('Horde_Log_Logger')));
-        $charset = 'UTF-8';
         $hash = $object->getAttributes();
         foreach ($hash as $field => $value) {
             switch ($field) {
             case 'name':
-                $message->fileas = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->fileas = $value;
                 break;
 
             case 'lastname':
-                $message->lastname = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->lastname = $value;
                 break;
 
             case 'firstname':
-                $message->firstname = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->firstname = $value;
                 break;
 
             case 'middlenames':
-                $message->middlename = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->middlename = $value;
                 break;
 
             case 'namePrefix':
-                $message->title = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->title = $value;
                 break;
 
             case 'nameSuffix':
-                $message->suffix = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->suffix = $value;
                 break;
 
             case 'photo':
@@ -2322,43 +2300,43 @@ class Turba_Driver implements Countable
             case 'homeStreet':
                 /* Address (TODO: check for a single home/workAddress field
                  * instead) */
-                $message->homestreet = Horde_String::convertCharset($hash['homeStreet'], $charset, 'utf-8');
+                $message->homestreet = $hash['homeStreet'];
                 break;
 
             case 'homeCity':
-                $message->homecity = Horde_String::convertCharset($hash['homeCity'], $charset, 'utf-8');
+                $message->homecity = $hash['homeCity'];
                 break;
 
             case 'homeProvince':
-                $message->homestate = Horde_String::convertCharset($hash['homeProvince'], $charset, 'utf-8');
+                $message->homestate = $hash['homeProvince'];
                 break;
 
             case 'homePostalCode':
-                $message->homepostalcode = Horde_String::convertCharset($hash['homePostalCode'], $charset, 'utf-8');
+                $message->homepostalcode = $hash['homePostalCode'];
                 break;
 
             case 'homeCountry':
-                $message->homecountry = !empty($hash['homeCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['homeCountry']), $charset, 'utf-8') : null;
+                $message->homecountry = !empty($hash['homeCountry']) ? Horde_Nls::getCountryISO($hash['homeCountry']) : null;
                 break;
 
             case 'workStreet':
-                $message->businessstreet = Horde_String::convertCharset($hash['workStreet'], $charset, 'utf-8');
+                $message->businessstreet = $hash['workStreet'];
                 break;
 
             case 'workCity':
-                $message->businesscity = Horde_String::convertCharset($hash['workCity'], $charset, 'utf-8');
+                $message->businesscity = $hash['workCity'];
                 break;
 
             case 'workProvince':
-                $message->businessstate = Horde_String::convertCharset($hash['workProvince'], $charset, 'utf-8');
+                $message->businessstate = $hash['workProvince'];
                 break;
 
             case 'workPostalCode':
-                $message->businesspostalcode = Horde_String::convertCharset($hash['workPostalCode'], $charset, 'utf-8');
+                $message->businesspostalcode = $hash['workPostalCode'];
                 break;
 
             case 'workCountry':
-                $message->businesscountry = !empty($hash['workCountry']) ? Horde_String::convertCharset(Horde_Nls::getCountryISO($hash['workCountry']), $charset, 'utf-8') : null;
+                $message->businesscountry = !empty($hash['workCountry']) ? Horde_Nls::getCountryISO($hash['workCountry']) : null;
 
             case 'homePhone':
                 /* Phone */
@@ -2385,28 +2363,28 @@ class Turba_Driver implements Countable
                 break;
 
             case 'title':
-                $message->jobtitle = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->jobtitle = $value;
                 break;
 
             case 'company':
-                $message->companyname = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->companyname = $value;
                 break;
 
             case 'departnemt':
-                $message->department = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->department = $value;
                 break;
 
             case 'category':
                 // Categories FROM horde are a simple string value, going BACK to horde are an array with 'value' and 'new' keys
-                $message->categories = explode(';', Horde_String::convertCharset($value, $charset, 'utf-8'));
+                $message->categories = explode(';', $value);
                 break;
 
             case 'spouse':
-                $message->spouse = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->spouse = $value);
                 break;
             case 'notes':
                 /* Assume no truncation - AS server will truncate as needed */
-                $message->body = Horde_String::convertCharset($value, $charset, 'utf-8');
+                $message->body = $value;
                 $message->bodysize = strlen($message->body);
                 $message->bodytruncated = false;
                 break;
@@ -2428,7 +2406,7 @@ class Turba_Driver implements Countable
         }
 
         if (empty($this->fileas)) {
-            $message->fileas = Horde_String::convertCharset(Turba::formatName($object), $charset, 'utf-8');
+            $message->fileas = Turba::formatName($object);
         }
 
         return $message;
@@ -2446,7 +2424,6 @@ class Turba_Driver implements Countable
     public function fromASContact($message)
     {
         $hash = array();
-        $charset = 'UTF-8';
         $formattedname = false;
 
         $textMap = array(
@@ -2474,7 +2451,7 @@ class Turba_Driver implements Countable
         );
         foreach ($textMap as $asField => $turbaField) {
             if (!$message->isGhosted($asField)) {
-                $hash[$turbaField] = Horde_String::convertCharset($message->{$asField}, 'utf-8', $charset);
+                $hash[$turbaField] = $message->{$asField};
             }
         }
 
@@ -2505,7 +2482,7 @@ class Turba_Driver implements Countable
 
         /* Categories */
         if (count($message->categories)) {
-            $hash['category'] = Horde_String::convertCharset(implode('|', $message->categories), 'utf-8', $charset);
+            $hash['category'] = implode('|', $message->categories);
         } elseif (!$message->isGhosted('categories')) {
             $hash['category'] = '';
         }
@@ -2529,7 +2506,7 @@ class Turba_Driver implements Countable
         if (!empty($message->homecountry)) {
             $country = array_search($message->homecountry, $countries);
             if ($country === false) {
-                $country = Horde_String::convertCharset($message->homecountry, 'utf-8', $charset);
+                $country = $message->homecountry;
             }
             $hash['homeCountry'] = $country;
         } elseif (!$message->isGhosted('homecountry')) {
@@ -2539,7 +2516,7 @@ class Turba_Driver implements Countable
         if (!empty($message->businesscountry)) {
             $country = array_search($message->businesscountry, $countries);
             if ($country === false) {
-                $country = Horde_String::convertCharset($message->businesscountry, 'utf-8', $charset);
+                $country = $message->businesscountry;
             }
             $hash['workCountry'] = $country;
         } elseif (!$message->isGhosted('businesscountry')) {
index 247e3c9..ec42005 100644 (file)
@@ -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) . ']).' . "Charset:UTF-8');
         }
     }
 
index 7994780..7367412 100644 (file)
@@ -248,7 +248,7 @@ class Turba_Object {
                         . ' '
                         . date($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:i a', $entry['ts'])
                         . ' '
-                        . @htmlspecialchars($by, ENT_COMPAT, 'UTF-8');
+                        . htmlspecialchars($by);
                 }
             }
         } catch (Exception $e) {
index 8acdba6..edd048a 100644 (file)
@@ -153,7 +153,7 @@ class Turba_View_Browse {
                     try {
                         $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title']), ENT_COMPAT, 'UTF-8');
+                        $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$targetSource]['title']));
                     }
                     $notification->push($message, 'horde.error', array('content.raw'));
                     break;
@@ -305,7 +305,7 @@ class Turba_View_Browse {
                         try {
                             $message = Horde::callHook('perms_denied', array('turba:max_contacts'));
                         } catch (Horde_Exception $e) {
-                            $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']), ENT_COMPAT, 'UTF-8');
+                            $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d contacts in \"%s\"."), $max_contacts, $cfgSources[$source]['title']));
                         }
                         $notification->push($message, 'horde.error', array('content.raw'));
                         break;
index 566030a..679f150 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 global $language;
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 489d770..01ecc97 100644 (file)
@@ -40,4 +40,4 @@ if (!$filename) {
     $filename = _("contact");
 }
 
-$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true)), 'UTF-8');
+$injector->getInstance('Horde_Data')->getData('Vcard')->exportFile($filename . '.vcf', array($driver->tovCard($object, '2.1', null, true)));
index 1f6b144..835d61a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index ed4b586..e31d107 100644 (file)
@@ -84,9 +84,9 @@ class Whups_Driver_sql extends Whups_Driver {
         $values = array(
             $new_id,
             Horde_String::convertCharset($name, 'UTF-8',
-                                   $this->_params['charset']),
+                                         $this->_params['charset']),
             Horde_String::convertCharset($description, 'UTF-8',
-                                   $this->_params['charset']),
+                                         $this->_params['charset']),
             $slug,
             $email);
         Horde::logMessage(
@@ -114,9 +114,9 @@ class Whups_Driver_sql extends Whups_Driver {
                  ' (type_id, type_name, type_description) VALUES (?, ?, ?)';
         $values = array($new_id,
                         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::logMessage(
             sprintf('Whups_Driver_sql::addType(): query="%s"; values="%s"',
                     $query, implode(',', $values)), 'DEBUG');
@@ -143,11 +143,11 @@ class Whups_Driver_sql extends Whups_Driver {
         $values = array($new_id,
                         $typeId,
                         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']));
         Horde::logMessage(
             sprintf('Whups_Driver_sql::addState(): query="%s"; values="%s"',
                     $query, implode(',', $values)), 'DEBUG');
@@ -174,9 +174,9 @@ class Whups_Driver_sql extends Whups_Driver {
         $values = array($new_id,
                         $typeId,
                         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::logMessage(
             sprintf('Whups_Driver_sql::addPriority(): query="%s"; values="%s"',
                     $query, implode(',', $values)), 'DEBUG');
index 8ca2731..867af66 100644 (file)
@@ -740,8 +740,6 @@ class Whups_Ticket {
         $message_file .= '.txt';
 
         /* Prepare message text. */
-        $message = Horde_String::convertCharset(file_get_contents($message_file),
-                                          'UTF-8');
         $message = str_replace(
             array('@@ticket_url@@',
                   '@@table@@',
@@ -751,7 +749,7 @@ class Whups_Ticket {
             array($url, $table, $dont_reply,
                   strftime($GLOBALS['prefs']->getValue('date_format')),
                   $name),
-            $message);
+            file_get_contents($message_file));
 
         /* Include Re: if the ticket isn't new for easy
          * filtering/eyeballing. */
index 5c05026..c4fe46b 100644 (file)
@@ -20,9 +20,7 @@ $name = $registry->get('name', 'whups') . ' (' . $url . ')';
 $icon = base64_encode(file_get_contents($registry->get('themesfs', 'whups') . '/graphics/whups.png'));
 
 // Charset.
-$charset = 'UTF-8';
-
-header('Content-Type: text/xml; charset=' . $charset);
+header('Content-Type: text/xml; charset=UTF-8');
 echo <<<PAYLOAD
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>$name</ShortName>
index 0c13675..e861885 100644 (file)
@@ -55,7 +55,6 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', 'UTF-8');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($whups_query->name ? $whups_query->name : _("Query Results")));
index 22e1f5d..7a6ea0b 100644 (file)
@@ -86,7 +86,6 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', 'UTF-8');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 if (isset($type) && isset($queue['name'])) {
index 9575160..bdb59ef 100644 (file)
@@ -47,7 +47,6 @@ foreach (array_keys($tickets) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', 'UTF-8');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', _("Search Results"));
index 12b58f8..dd5ee2d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index c329306..12cec5e 100644 (file)
@@ -42,7 +42,6 @@ foreach (array_keys($history) as $i) {
 }
 
 $template = $injector->createInstance('Horde_Template');
-$template->set('charset', 'UTF-8');
 $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
 $template->set('pubDate', htmlspecialchars(date('r')));
 $template->set('title', htmlspecialchars($details['summary']));
index e47f8a0..ea2314b 100644 (file)
@@ -107,8 +107,8 @@ class MergeOrRename extends Wicked_Page {
         }
 
         foreach ($references as $key => $page) {
-            $references[$key]['page_url'] = @htmlspecialchars(Wicked::url($page['page_name']), ENT_QUOTES, 'UTF-8');
-            $references[$key]['page_name'] = @htmlspecialchars($page['page_name'], ENT_QUOTES, 'UTF-8');
+            $references[$key]['page_url'] = htmlspecialchars(Wicked::url($page['page_name']));
+            $references[$key]['page_name'] = htmlspecialchars($page['page_name']);
 
             // Since the page name can have [ and ] and other special
             // characters in it, and we don't want the browser or PHP decoding
index 0b31989..0e0a1d9 100644 (file)
@@ -20,7 +20,7 @@ class Text_Wiki_Render_Xhtml_Code2 extends Text_Wiki_Render_Xhtml_Code
         $part->setContents($options['text']);
         $part->setType("x-extension/$type");
 
-        $viewer = new Horde_Core_Mime_Viewer_Syntaxhighlighter($part, array('registry' => $GLOBALS['registry'], 'charset' => 'UTF-8'));
+        $viewer = new Horde_Core_Mime_Viewer_Syntaxhighlighter($part);
         $data = $viewer->render('inline');
         $data = reset($data);
         return $data['data'];
index 80dd36e..5483bc2 100644 (file)
@@ -24,9 +24,7 @@ $name = $registry->get('name', 'wicked') . ' (' . $url . ')';
 $icon = base64_encode(file_get_contents($registry->get('themesfs', 'wicked') . '/graphics/wicked.png'));
 
 // Charset.
-$charset = 'UTF-8';
-
-header('Content-Type: text/xml; charset=' . $charset);
+header('Content-Type: text/xml; charset=UTF-8');
 echo <<<PAYLOAD
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>$name</ShortName>
@@ -38,7 +36,7 @@ echo <<<PAYLOAD
     <Param name="params" value="{searchTerms}"/>
   </Url>
   <Image height="16" width="16">data:image/png;base64,$icon</Image>
-  <InputEncoding>$charset</InputEncoding>
+  <InputEncoding>UTF-8</InputEncoding>
 
 </OpenSearchDescription>
 PAYLOAD;
index 314679e..19da3f3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (isset($language)) {
-    header('Content-type: text/html; charset=' . 'UTF-8');
+    header('Content-type: text/html; charset=UTF-8');
     header('Vary: Accept-Language');
 }
 ?>
index 1abee72..51420e8 100644 (file)
@@ -26,7 +26,7 @@ function preview()
 </div>
 
 <div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, 'UTF-8') ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo htmlspecialchars($page_text) ?></textarea>
 </div>
 
 </form>
index 621cb08..7bfa261 100644 (file)
@@ -45,7 +45,7 @@ if (!empty($GLOBALS['conf']['wicked']['captcha']) && !$GLOBALS['registry']->getA
 <?php endif; endif; ?>
 
 <div style="padding:8px">
- <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo @htmlspecialchars($page_text, ENT_COMPAT, 'UTF-8') ?></textarea>
+ <textarea class="fixed" style="width:100%" name="page_text" rows="29" cols="100"><?php echo htmlspecialchars($page_text) ?></textarea>
 </div>
 
 </form>
index 9565005..e4158ff 100644 (file)
@@ -40,5 +40,5 @@ if ($show_restore) {
  <td style="text-align:center"><input type="submit" class="button" value="<?php echo htmlspecialchars($page->version()) ?>" onclick="if (document.diff.v1[<?php echo $i ?>].checked) return false; document.diff.v2.value = '<?php echo htmlspecialchars($pversion) ?>';" /></td>
 <?php endif; ?>
 
- <td><?php echo @htmlspecialchars($page->changeLog(), ENT_COMPAT, 'UTF-8') ?></td>
+ <td><?php echo htmlspecialchars($page->changeLog()) ?></td>
 </tr>