Merge branch 'w52_MDL-30953_m23_pspell' of git://github.com/skodak/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 2 Jan 2012 19:19:43 +0000 (20:19 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 2 Jan 2012 19:19:43 +0000 (20:19 +0100)
lib/editor/tinymce/tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php

index cac33bb..2ab09da 100644 (file)
@@ -21,7 +21,7 @@ class PSpell extends SpellChecker {
                $outWords = array();
                foreach ($words as $word) {
                        if (!pspell_check($plink, trim($word)))
-                               $outWords[] = utf8_encode($word);
+                               $outWords[] = $word;
                }
 
                return $outWords;
@@ -37,9 +37,6 @@ class PSpell extends SpellChecker {
        function &getSuggestions($lang, $word) {
                $words = pspell_suggest($this->_getPLink($lang), $word);
 
-               for ($i=0; $i<count($words); $i++)
-                       $words[$i] = utf8_encode($words[$i]);
-
                return $words;
        }
 
@@ -56,7 +53,7 @@ class PSpell extends SpellChecker {
                        $lang,
                        $this->_config['PSpell.spelling'],
                        $this->_config['PSpell.jargon'],
-                       $this->_config['PSpell.encoding'],
+                       empty($this->_config['PSpell.encoding']) ? 'utf-8' : $this->_config['PSpell.encoding'],
                        $this->_config['PSpell.mode']
                );