Changeset 498
- Timestamp:
- 04/30/06 09:46:23 (7 years ago)
- Location:
- trunk/plugins/SpellChecker
- Files:
-
- 4 modified
-
spell-check-logic.php (modified) (1 diff)
-
spell-check-ui.html (modified) (1 diff)
-
spell-check-ui.js (modified) (1 diff)
-
spell-checker.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/SpellChecker/spell-check-logic.php
r418 r498 3 3 4 4 // Convert UTF-8 multi-bytes into decimal character entities. This is because 5 // aspell isn't fully utf8-aware 6 $text = preg_replace('/([\xC0-\xDF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 7 $text = preg_replace('/([\xE0-\xEF][\x80-\xBF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 8 $text = preg_replace('/([\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 9 5 // aspell isn't fully utf8-aware - ticket:120 raises the possibility 6 // that this is not required (any more) and so you can turn it off 7 // with editor.config.SpellChecker.utf8_to_entities = false 8 if(!isset($_REQUEST['utf8_to_entitis']) || $_REQUEST['utf8_to_entities']) 9 { 10 $text = preg_replace('/([\xC0-\xDF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 11 $text = preg_replace('/([\xE0-\xEF][\x80-\xBF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 12 $text = preg_replace('/([\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF])/e', "'&#' . utf8_ord('\$1') . ';'", $text); 13 } 14 10 15 function utf8_ord($chr) 11 16 { -
trunk/plugins/SpellChecker/spell-check-ui.html
r415 r498 63 63 /><input type="hidden" name="dictionary" id="f_dictionary" 64 64 /><input type="hidden" name="init" id="f_init" value="1" 65 /><input type="hidden" name="utf8_to_entities" id="utf8_to_entities" value="1" 65 66 /></form> 66 67 -
trunk/plugins/SpellChecker/spell-check-ui.js
r419 r498 216 216 field.form.action = _editor_url + '/plugins/SpellChecker/spell-check-logic.php'; 217 217 } 218 218 if(editor.config.SpellChecker.utf8_to_entities) 219 { 220 document.getElementById('utf8_to_entities').value = 1; 221 } 222 else 223 { 224 document.getElementById('utf8_to_entities').value = 0; 225 } 219 226 field.form.submit(); 220 227 document.getElementById("f_init").value = "0"; -
trunk/plugins/SpellChecker/spell-checker.js
r419 r498 9 9 // $Id$ 10 10 11 HTMLArea.Config.prototype.SpellChecker = { 'backend': 'php', 'personalFilesDir' : '', 'defaultDictionary' : 'en_GB' };11 HTMLArea.Config.prototype.SpellChecker = { 'backend': 'php', 'personalFilesDir' : '', 'defaultDictionary' : 'en_GB', 'utf8_to_entities' : true }; 12 12 13 13 function SpellChecker(editor) {
