Special Language Characters not displaying

122 views Asked by At

I am trying to add languages with special characters in CkEditor but It doesn't seem to work. I've tried adding config.language = 'sv'; to the config.js which didnt work so I installed language addon, also didnt help...

When I type in a text and submit it, It doesnt display rest of the text from where the special character was added.

Det här är en test (This is a test) Which later on is displayed as Det h

UPDATE:

AJAX CALL

$('.newcomment_submit').click(function(){
      var newcomment_txtarea = CKEDITOR.instances['comment_txtarea'].getData();
      $.ajax({
        url:'/tsw/pages/s_comment.php',
        type:'post',
        data:$('.comment_form').serialize()+'&newcomment_txtarea='+newcomment_txtarea,
        success: function(data){
          alert(data);
        }
      });
    });

PHP SCRIPT:

  session_start();
  require('connect.php');
  if(!isset($_SESSION['id'])){
    echo "err#sess";
  } else {
    if(strlen($_POST['newcomment_txtarea']) < 5) {
      echo "err#shortcmt";
    } else {
      if($dbh->exec('INSERT INTO `comments`(`post_id`,`commenter_id`,`comment`) VALUES('.$dbh->quote($_POST['post_id']).','.$dbh->quote($_POST['commenter_id']).','.$dbh->quote($_POST['newcomment_txtarea']).')')){
        echo "success";
      } else {
        echo "err#insert";
      }
    }
  }
1

There are 1 answers

0
Feelsbadman On BEST ANSWER

After doing some more research on the problem I have found a solution which is basically adding config.entities = false; to the config.js file and special language characters won't be escaped.