| 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 | |