diff -Naur a/calendar/view.php b/calendar/view.php
--- a/calendar/view.php	2011-01-21 17:08:05.000000000 -0800
+++ b/calendar/view.php	2011-01-21 17:08:34.000000000 -0800
@@ -166,17 +166,22 @@
     //Link to calendar export page
     echo '<div class="bottom">';
     if (!empty($CFG->enablecalendarexport)) {
-        print_single_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar'));
+        if (function_exists('md_strlen')) {
+            print_single_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar'));
 
-        if (!empty($USER->id)) {
-            $authtoken = sha1($USER->username . $USER->password . $CFG->calendar_exportsalt);
-            $usernameencoded = urlencode($USER->username);
-
-            echo "<a href=\"export_execute.php?preset_what=all&amp;preset_time=recentupcoming&amp;username=$usernameencoded&amp;authtoken=$authtoken\">"
-                 .'<img src="'.$CFG->pixpath.'/i/ical.gif" height="14" width="36" '
-                 .'alt="'.get_string('ical', 'calendar').'" '
-                 .'title="'.get_string('quickdownloadcalendar', 'calendar').'" />'
-                 .'</a>';
+            if (!empty($USER->id)) {
+                $authtoken = sha1($USER->username . $USER->password . $CFG->calendar_exportsalt);
+                $usernameencoded = urlencode($USER->username);
+
+                echo "<a href=\"export_execute.php?preset_what=all&amp;preset_time=recentupcoming&amp;username=$usernameencoded&amp;authtoken=$authtoken\">"
+                   .'<img src="'.$CFG->pixpath.'/i/ical.gif" height="14" width="36" '
+                   .'alt="'.get_string('ical', 'calendar').'" '
+                   .'title="'.get_string('quickdownloadcalendar', 'calendar').'" />'
+                   .'</a>';
+            }
+        } else {
+            // MDL-24235: site administrator has enabled calendar export but mbstring is not installed
+            notify(get_string('errormbstring','calendar'));
         }
     }
 
diff -Naur a/lang/en_utf8/calendar.php b/lang/en_utf8/calendar.php
--- a/lang/en_utf8/calendar.php	2011-01-21 17:07:49.000000000 -0800
+++ b/lang/en_utf8/calendar.php	2011-01-21 17:08:19.000000000 -0800
@@ -27,6 +27,7 @@
 $string['errorinvaliddate'] = 'Invalid date';
 $string['errorinvalidminutes'] = 'Specify duration in minutes by giving a number between 1 and 999.';
 $string['errorinvalidrepeats'] = 'Specify the number of events by giving a number between 1 and 99.';
+$string['errormbstring'] = 'The Multibyte String extension is not installed; calendar export is unavailable.';
 $string['errornodescription'] = 'Description is required';
 $string['errornoeventname'] = 'Name is required';
 $string['eventdate'] = 'Date';
