Moodle 1.3.1 - Fatal error: Unknown function: mb_strtolower()

Moodle 1.3.1 - Fatal error: Unknown function: mb_strtolower()

by Chris Mawson -
Number of replies: 5

Upgraded from 1.2.1 to 1.3.1 on Friday and all seemed well, could login, post to forums, etc.

However now no-one can login to moodle or any moodle course, but they can get to the main moodle page.

The following error appears after login attempt.

Fatal error: Unknown function: mb_strtolower() in /home/ictpd/public_html/moodle/lib/moodlelib.php on line 2307

Thanks

Chris

Average of ratings: -
In reply to Chris Mawson

Re: Moodle 1.3.1 - Fatal error: Unknown function: mb_strtolower()

by Gustav W Delius -

That is very strange indeed. There must be something wrong in your moodlelib.php file. Perhaps it got corrupted during download? Can you check that the neighbourhood of line 2307 looks as follows:

function moodle_strtolower ($string, $encoding='') {
/// Converts string to lowercase using most compatible  function available
    if (function_exists('mb_strtolower')) {
        if($encoding===''){
           return mb_strtolower($string);          //use multibyte support with default encoding
        } else {
           return mb_strtolower($string,$encoding); //use given encoding
        }
    } else {
        return strtolower($string);                // use common function what rely on current locale setting
    }
}

In reply to Gustav W Delius

Re: Moodle 1.3.1 - Fatal error: Unknown function: mb_strtolower()

by Chris Mawson -

Hi.

Mine looks the same I think. The first line is 2303.

However I just noticed there is an extra space between 'compatible  function' (second line) in my version (also on your copy paste also I think). I removed this and I can login now, so this must be the problem.

How could this have occurred though, I didn't edit this file previously?

========================

function moodle_strtolower ($string, $encoding='') {
/// Converts string to lowercase using most compatible  function available
    if (function_exists('mb_strtolower')) {
        if($encoding===''){
           return mb_strtolower($string);          //use multibyte support with default encoding
        } else {
           return mb_strtolower($string,$encoding); //use given encoding
        }
    } else {
        return strtolower($string);                // use common function what rely on current locale setting
    }
}

Thanks

Chris

In reply to Chris Mawson

curious resolution

by Gustav W Delius -

I am glad your moodle is working again. However removing that space should have had nothing to do with it (it is a space inside a comment). Are you sure you didn't change something else as well?

These ========= that are in your post did you put them there to make it more legible or were they actually in your moodlelib.php? If the later, are there also some >>>>>>> and <<<<<<< around? Those would be conflict markers that cvs puts in when there is a conflict between different versions of the file.

In reply to Gustav W Delius

Re: curious resolution

by Thomas Robb -
Actually, I think that there might be an illegal/upper ASCII character there that affects some systems and not others-- probably the one for a non-break space.
In reply to Gustav W Delius

Re: curious resolution

by Chris Mawson -

Hi.

Yes of course, I should have realised that line was a 'comment' (bit late at night), and that editing this should have no effect.

The =========== was my inclusion.

I didn't edit anything else so I don't know what it was then or why it now works.

There aren't any >>>>>>> and <<<<<<< around either.

Strange.