diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 487e81f4557..5a6b476f188 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2791,8 +2791,6 @@ function set_login_session_preferences() { $SESSION->justloggedin = true; unset($SESSION->lang); - unset($SESSION->encoding); - $SESSION->encoding = current_charset(); // Restore the calendar filters, if saved if (intval(get_user_preferences('calendar_persistflt', 0))) { diff --git a/lib/setup.php b/lib/setup.php index c433db38805..16860a354bd 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -457,7 +457,6 @@ global $HTTPSPAGEREQUIRED; if (!detect_munged_arguments($lang, 0) and (file_exists($CFG->dataroot .'/lang/'. $lang) or file_exists($CFG->dirroot .'/lang/'. $lang))) { $SESSION->lang = $lang; - $SESSION->encoding = get_string('thischarset'); } } if (empty($CFG->lang)) { diff --git a/lib/weblib.php b/lib/weblib.php index e9b1df4ab7d..e73920fffd1 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1920,7 +1920,6 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta= if (!empty($CFG->courselang)) { moodle_setlocale(); } - $SESSION->encoding = $encoding; $meta = ''. "\n". $meta ."\n"; if (!$usexml) { diff --git a/mod/resource/type/ims/resource.class.php b/mod/resource/type/ims/resource.class.php index 910f8c9f4e7..4bc1c17e8be 100644 --- a/mod/resource/type/ims/resource.class.php +++ b/mod/resource/type/ims/resource.class.php @@ -676,24 +676,16 @@ class resource_ims extends resource_base { /// Configure links behaviour $fullurl = $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'&frameset=ims&page='; - /// Decide if we have to leave text in UTF-8, else convert to ISO-8859-1 - /// (interim solution until everything was migrated to UTF-8). Then we'll - // delete this hack. - $convert = true; - if ($SESSION->encoding == 'UTF-8') { - $convert = false; - } - /// Iterate over items to build the menu $currlevel = 0; $currorder = 0; $endlevel = 0; foreach ($items as $item) { - /// Convert text to ISO-8859-1 if specified (will remove this once utf-8 migration was complete- 1.6) - if ($convert) { - $item->title = utf8_decode($item->title); - } - + /// Convert text from UTF-8 to current charset if needed + if (empty($CFG->unicodedb)) { + $textlib = textlib_get_instance(); + $item->title = $textlib->convert($item->title, 'UTF-8', current_charset()); + } /// Skip pages until we arrive to $page if ($item->id < $page) { continue;