From 8b19cf4fc7777f03b4fede41cd671ca4f5e955a1 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 2 Jan 2012 12:49:09 +0100 Subject: [PATCH] MDL-30953 fix utf-8 support in PSpell class Credit for discover and proposed fix goes to David Hai Gootvilig, this patch is part of https://github.com/moodle/custom-tinymce_spellchecker_php/tree/MOODLE_22_2.0.6b which will be used in the next tinymce import. It was reported upstream as https://github.com/tinymce/tinymce_spellchecker_php/pull/5 --- .../tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/editor/tinymce/tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php b/lib/editor/tinymce/tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php index cac33bb6a59ee..2ab09da3e8bec 100644 --- a/lib/editor/tinymce/tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php +++ b/lib/editor/tinymce/tiny_mce/3.4.6/plugins/spellchecker/classes/PSpell.php @@ -21,7 +21,7 @@ function &checkWords($lang, $words) { $outWords = array(); foreach ($words as $word) { if (!pspell_check($plink, trim($word))) - $outWords[] = utf8_encode($word); + $outWords[] = $word; } return $outWords; @@ -37,9 +37,6 @@ function &checkWords($lang, $words) { function &getSuggestions($lang, $word) { $words = pspell_suggest($this->_getPLink($lang), $word); - for ($i=0; $i_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'] );