diff --git a/login/index.php b/login/index.php
index <HASH>..<HASH> 100644
--- a/login/index.php
+++ b/login/index.php
@@ -113,7 +113,10 @@
             set_moodle_cookie($USER->username);
 
             unset($SESSION->lang);
+            unset($SESSION->encoding);
+
             $SESSION->justloggedin = true;
+            $SESSION->encoding = get_string('thischarset');
 
             // Restore the calendar filters, if saved
             if(intval(get_user_preferences('calendar_persistflt', 0))) {
SESSION encoding fix from STABLE   (<I>)