Size: 1212
Comment: better name
|
Size: 1597
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 37: | Line 37: |
Is the words file part of the system or part of the distribution? If its part of the system, and its always using iso-8859-1, we can accept this encoding. Generally its easy to accept both utf-8 and iso-8895-1 in the same code, using: {{{ words = file(wordsfile).read() try: words = unicode(words, 'utf-8') except UnicodeError: words = unicode(words, 'iso-8859-1') }}} |
Description
The spellchecker does not catch UnicodeErrors.
Steps to reproduce
- Create a dictionary in MM/dict with non-utf8 encoding
- Delete dict cache in wiki instance
- Run spellcheck
Bombs with stack trace UnicodeDecodeError'utf8 (sorry, i fixed it before i could save the trace)
It should give a better error message like your file isnt in utf8, please see the admin
Example
Details
This wiki.
Workaround
Use iconv words --to-encoding=utf-8 > words-utf8 and delete cache
Discussion
Is the words file part of the system or part of the distribution? If its part of the system, and its always using iso-8859-1, we can accept this encoding. Generally its easy to accept both utf-8 and iso-8895-1 in the same code, using:
words = file(wordsfile).read() try: words = unicode(words, 'utf-8') except UnicodeError: words = unicode(words, 'iso-8859-1')
Plan
- Priority:
- Assigned to:
- Status: