Opened 12 years ago

Closed 12 years ago

#204 closed defect (fixed)

Resolved issues with the SpellChecker PHP logic

Reported by: kim@… Owned by: niko
Priority: normal Milestone:
Component: Plugin_Fullscreen Version:
Severity: major Keywords:
Cc:

Description

The SpellChecker PHP logic has som issues I have resolved, changes are needed in two of the files which are attached. If you need to validate my changes use WinMerge? to validate the changes. The changes are also at the latest build.

spell-check-logic.php

  • When spellchecking empty document, some of the HTML was generated inside the logic, resulting in faulty HTML code being presented.
  • The documented is supposed to be utf-8, but the output was never converted to utf-8.
  • When listing the dictionaries an extra , was presented in the string which resulted in the JS logic to create empty dictionary in dropdown
  • Debug mode, run this file directly in browser and file is served as plain text, its easier to debug this way.

spell-check-ui.js

  • commenting out one line in the bottom of the doument. This line made the selected dictionary vanish, which made the whole logic bad.

Attachments (2)

spell-check-logic.php (7.2 KB) - added by kim@… 12 years ago.
Revised file
spell-check-ui.js (13.9 KB) - added by spell-check-ui.js 12 years ago.
Revised file

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by kim@…

Revised file

Changed 12 years ago by spell-check-ui.js

Revised file

comment:1 Changed 12 years ago by anonymous

Just incase some of you dont know what WinMerge? is :
http://winmerge.sourceforge.net/

Grab it, bag it and start to use it, :) Soon your life just isnt the same again without it.

comment:2 Changed 12 years ago by niko

kompare does the job for me :D
http://en.wikipedia.org/wiki/Kompare

and TortoiseMerge? is nice too!

comment:3 Changed 12 years ago by niko

i tested your fix and found out that the utf8_encode is not necessary.
this is becasue the text is allready in utf8 encoded!
so you would encode the text twice - i tested it with "dt" and the ö-chars where displayed wrong...

the others fixes work well...

comment:4 Changed 12 years ago by niko

btw: woldn't it be possible for you to post patches?

  • they are smaller
  • easier to read
  • you see at the first view what has changed
  • you don't need an additional application (but you can apply the patches and use winmerge or something)

comment:5 Changed 12 years ago by anonymous

i tested your fix and found out that the utf8_encode is not necessary.

This is not true for my Norwegian computer, there was a good reason for why I added the UTF-8 encode, so it must be there. Problem is that the document is declared as UTF-8, but PHP outputs the variables with ANSI or whatever the default encoding is for PHP on the server. PHP and UTF-8 doesnt work very well, you will find lots of post with this.

The text is not encoded twice, so leave the UTF-8 encode.

I will post only patches in future and not the entire files, :)

comment:6 Changed 12 years ago by gogo

  • Owner changed from gogo to niko

spellchecking in foreign (non-english) languages is a bit troublesome, because aspell doesn't properly support non-ascii character sets, it has some rudimentary support for utf-8 now (it ignores it I believe) but you probably will be lucky to get anything useful out of it.

niko: if you have examined these and everything seems fine can you apply the changes and then close off this ticket noting the changeset

comment:7 Changed 12 years ago by niko

  • Resolution set to fixed
  • Status changed from new to closed

commited fix for spell-check-ui.js as changeset:136

commited fix for spell-check-logic.php as changeset:137

the utf8-fixes don't work for me as allready posted.

Note: See TracTickets for help on using tickets.