Umlaut troubles after installation of quote block

Umlaut troubles after installation of quote block

by jonas solo -
Number of replies: 1
Hi all,

I recently installed the Quote_of_the_day Block in my Moodle 1.6 and "misused" it as Random-images + copyrightinfo viewer.
It works great and simple. Not hacking was needed.
But when the site is reloaded moodle doesn´t want to show the german umlauts anymore. But if you switch the quote block off, the umlauts are back again. Really strange.. have no clue how to solve this issue.
Please find the source of the block below.
Any ideas are warmly welcomed.
Thanks guys.

Jonas
-----------------
<?php //Aggelos Panagiotakis made this!
class block_quote_of_the_day_txt_file extends block_base {
    function init() {
        $this->title = get_string('quote_of_the_day_txt_file', 'block_quote_of_the_day_txt_file'); //'Quote of the day';
        $this->version = 2005031300;
    }

    function get_content() {
    global $CFG;
        if ($this->content !== NULL) {
                return $this->content;
        }

    $this->content = new stdClass;
    $textfile = $CFG->wwwroot . '/blocks/' . $this->name() .'/quotes.txt';
    $quotes = file("$textfile");
    $quote = rand(0, sizeof($quotes)-1);
    $tmp_content =$quotes[$quote];
    $this->content->text = $tmp_content;
    $this->content->footer = '';

    return $this->content;
    }
}
?>
----------------------------
Average of ratings: -
In reply to jonas solo

Re: Umlaut troubles after installation of quote block

by Jan Dierckx -

The problem looks characterset related, so I would think this block needs to be updated to be compatible with Moodle 1.6.

If the developer doesn't want to do that, you could also use the random glossary entry block (part of standard Moodle 1.6 release) to achieve a similar effect...

(Screenshot shows a sample of strange American influences in a Belgian school)

Another solution would be to use the random picture block (somewhere on this page but that one doesn't have an option to display the copyright info.