rizkit1 / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
GNU General Public License v2.0
0 stars 0 forks source link

special characeters not encoded #214

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. When I paste a text with ë or ç, puts same thing on db.
2.
3.

What is the expected output? What do you see instead?

I expect to replace them with ë or ç like tinymce or ck does/

What version of the product are you using? On what operating system?

0.6 OSX firefox 3.6

Please provide any additional information below.
Should editor take care of those special characters?

Original issue reported on code.google.com by flakerimi on 9 Oct 2010 at 10:27

GoogleCodeExporter commented 8 years ago
A function like this should be implemeted:

function HTMLEncode(str){
     var aStr = str.split(''),
         i = aStr.length,
         aRet = [];

     while (--i) {
      var iC = aStr[i].charCodeAt();
       if (iC < 65 || iC > 127 || (iC>90 && iC<97)) {
        aRet.push('&#'+iC+';');
       } else {
        aRet.push(aStr[i]);
       }
    }
    return aRet.reverse().join('');
   }

Original comment by flakerimi on 9 Oct 2010 at 12:46

GoogleCodeExporter commented 8 years ago
i have fixed this in my fork at commit 75572925497bdd957ff9 ( 
http://github.com/alecgorge/jwysiwyg/commit/75572925497bdd957ff920a2016cad8f3703
b62a )

This will likely be pull into master in the next week.

Thanks for the bug report,
Alec

Original comment by alecgo...@gmail.com on 21 Oct 2010 at 5:09

GoogleCodeExporter commented 8 years ago
While doing some more research, I think this should be as option and not build 
in.

Why?
When you save text to database, all ë will be ë. This is good to render the 
content because doesn't have problems with Character Encoding, but if you want 
to search a word, like Citroën it will not show up since it is Citroën on DB.

Maybe it can be as part of Config Options since someone might need it. Default 
should not replace chars.

Original comment by flakerimi on 2 Dec 2010 at 7:44