Reputation: 97
I have several wysiwyg textareas using CKEditor 4. I store the data in a MYSQL database. If I leave the textarea blank and submit it to the database, CKEditor automatically inserts a special character Â
Â. Anyone know a fix for this?
HTML:
<textarea cols="60" rows="8" name="description" class="ckeditor"></textarea>
PHP:
// Handler stuff here
$name = $_POST['name'];
$title = $_POST['title'];
$description = $_POST['description'];
$sql = "INSERT INTO `aircraft`
(name,
description,
title)
VALUES (?, ?, ?)";
$sth = $this->dbh->prepare($sql);
$sth->execute(array($name, $description, $title));
Upvotes: 2
Views: 4688
Reputation: 21
Only change :
OLD
<script type="text/javscrip" src="ckeditor/ckeditor.js"></script>
NEW
<script type="text/javscrip" src="ckeditor/ckeditor.js" charset="utf-8"></script>
Have a good day
Upvotes: 2
Reputation: 31
3 years later and this is still a problem ...
user1867004's suggestion worked for me.
Add this to config.js:
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
Upvotes: 2
Reputation: 5560
You have actually faced a bug that was fixed just a while ago: http://dev.ckeditor.com/ticket/9732
Redownload CKEditor, clear browser's cache and the issue should be gone.
Upvotes: 2