Tested in Chrome and Firefox.
My page and DB is UTF-8
My language is Spanish.
I got the thing preetty nailed out. Even without actually editting anything, the editor is putting random special characters after my correctly inputed special characters.
for example:
í should be í but is making to the DB like this í­ I don't know why.
I've tried solutions like setting my encoding to UTF8 in .htaccess and so on, but the page is OK, even special chars in the HTML are rendered ok (with a browser not forced to windows cp1525).
Also:
Whenever I edit something I know it's right in the DB (phpMyAdmin shows good marked HTML) and the editr shows wrongly and thus exitnding the problem wih each editing...
Disabling CKEditor for the "filtered HTML" and this problem doesn't happen at all.
I saw lots of threads in the CKEditor forum with CKEditor having problems with UTF8 encoded data, at this point I'm at the verge of choosing another editor.
Comment | File | Size | Author |
---|---|---|---|
#13 | db_utf8.png | 46.09 KB | donSchoe |
#13 | db_utf8_proof.png | 48.24 KB | donSchoe |
#13 | utf8_issues.png | 30.13 KB | donSchoe |
#9 | phpinfo.zip | 9.12 KB | donSchoe |
Comments
Comment #1
SebaSOFT CreditAttribution: SebaSOFT commentedBTW using the CKEditor 3.6.1
Comment #2
dczepierga CreditAttribution: dczepierga commentedHi,
Pls try to change value of "HTML Entities" in CKEditor profile -> Advanced settings section. It should help.
Greetings
Comment #3
dczepierga CreditAttribution: dczepierga commentedComment #5
mkesicki CreditAttribution: mkesicki commentedThis issue looks similar to #1266406: NLS Problem
Comment #6
mkesicki CreditAttribution: mkesicki commented@SebaSOFT can you check character encoding in your browser ?
Please also character encoding on your site ?
I also use UTF-8 in database and don't have any problems with characters (in polish language).
Comment #7
SebaSOFT CreditAttribution: SebaSOFT commentedI deactivated "HTML Entities" (which I don't want disabled BTW) and it saved the special char to the DB correctly, then whenever I want to edit random chars are added even to the textarea underneath.
also BTW
Page encoding UTF8
Browser encoding UTF8 (autodetected)
MySQL encoding utf8_general_ci
Comment #8
dczepierga CreditAttribution: dczepierga commented@SebaSOFT, could u attach here file with the result of
phpinfo()
function?Greetings
Comment #9
donSchoe CreditAttribution: donSchoe commentedHi,
I'm re-opening this issue as I have the same problem with malformed character encoding. (I'm using german language but it doesn't matter as any HTML special character gets malformed.)
Example
ä
gets correctly converted by the CKEditor to<p>ä</p>
.<p>ä</p>
gets malformed to<p>ä</p>
. (Looks like this:ä
)<p>ä</p>
. (Looks like this:ä
)I've checked everything mentioned above
Please help us, to track down this problem, it's really annoying to manage content this way. :)
-- donSchoe
Comment #10
dczepierga CreditAttribution: dczepierga commentedCould u try to update your CKEditor module to last DEV version and in CKEditor profile in "Security" section change value of "Use Drupal text format filters" to "Disabled"?
After change this pls try again to test it and write here your result.
Greetings
Comment #11
goood CreditAttribution: goood commentedI have the same problem as donSchoe.
New DEV version doesn't fix this problem.
But this problem appears only in non IE browsers. In IE 8 it is OK.
On my localhost works everything fine even in Firefox 7.0 or Chrome ...
CKEditor: 3.6.2
CKEditor-Module: 7.x-1.3 (last DEV version checked too)
Server configuration:
PHP 5.3.8
Apache 2.2.3
MySQL 5.0.77
localhost:
PHP 5.3.1
Apache 2.2.14
MySQL: 5.1.41
Comment #12
mkesicki CreditAttribution: mkesicki commented@goood m @donSchoe guys are you sure that your connection with database is UTF-8 ? Is your data correct saved in database ?
Comment #13
donSchoe CreditAttribution: donSchoe commentedHi, as I already mentioned in comment #9, I double-checked everything. See attached screenshots.
Comment #14
donSchoe CreditAttribution: donSchoe commented@#11
It seems not to be browser-related as this problem persists with the following browsers:
Comment #15
mkesicki CreditAttribution: mkesicki commentedI think that this problem is related with bad encoding of database connection or browser.
Do you use any custom module or theme ? What modules do you have installed.
Please check http://dev.ckeditor.com/ticket/7564 - someone has similar problem to this one. This problem was caused by user's php code.
Please remember that you have utf8_unicode_ci codding set in you PhpMyAdmin it doesn't mean that your drupal also connect to database with this encoding. Please read about database connection configuration: http://api.drupal.org/api/drupal/sites--default--default.settings.php/7/... (reading settings file for drupal6 can also be helpful) and check database settings in your installation.
Comment #16
goood CreditAttribution: goood commentedI don't understand, but now it is ok. I didn't make any changes in settings.php...
I will watch it and check if it will be ok or not and try to check what happens...
edit:
I'am sorry for mistaking. It is not ok. I tried to add
'collation' => 'utf8_general_ci', into database settings in settings.php, and it had no effect.
When I edit some article, textarea with text is ok (encoding is ok), but when CK editor appears, encoding is wrong
Here are my extra modules:
webform
captcha
menu_block
admin_menu
features
devel
job_scheduler
advanced_help
pathauto
date
ctools
l10n_update
custom_search
views
transliteration
backup_migrate
conditional_fields
token
devel_themer
ckeditor
taxonomy_menu
feeds_xpathparser
feeds
better_exposed_filters
Comment #17
mkesicki CreditAttribution: mkesicki commentedRemember that when you change database connection encoding after you have data saved in database it doesn't help.
I think this is drupal default collation.
Can I see your site somewhere ? You can send me login data (if necessary ) in e-mail .
Comment #18
alwor CreditAttribution: alwor commentedI have the exact same problem as #9 after moving to a new server. Works fine on the old server.
I just tried to reinstall the ckeditor module (new version 7.x-1.4 as of yesterday) and update the editor to 3.6.2. But to no avail.
All charactersets I find are utf8_general_ci, and have set 'collation' => 'utf8_general_ci' in settings.php.
Tried toggling rich editor off as default, and the text displays correctly in the plain text editor on edit, but if I toggle to the rich text editor I get the weird characters again. Then, if toggle back to the plain text editor, it keeps the weird characters.
Any ideas are welcome.
Comment #19
mkesicki CreditAttribution: mkesicki commentedPlease try disable all filters (drupal and CKEditor). Check if this change anything.
Comment #20
alwor CreditAttribution: alwor commentedAah, thank you. For me it's the security filter - if the rich text editor is disabled initially and the Security settings are set to " Run security filters only when CKEditor is set to start automatically", then the problem will not occur.
OK, so that's a good workaround, but what to do to fix the security settings and have the rich text editor on by default?
Comment #21
mkesicki CreditAttribution: mkesicki commented@alwor
what filters and in what order do you have enabled ?
Guys can you check yours filters settings.
Does this http://drupal.org/node/1283918#comment-5169538 change anything for you ?
Comment #22
goood CreditAttribution: goood commentedThe same think as alwor, but not depends on Security settings. It doesn't matter whether is in "Always run security filters for CKEditor" or "Run security filters only when CKEditor is set to start automatically" mode. Critical for me is if CkEditor is enabled initially. If not, problem will not occur.
What filters do you mean exactly?
Comment #23
mkesicki CreditAttribution: mkesicki commented@goood , so if you have CKEditor disabled on start and than you start it (switch to rich text editor) everything works ok, but when CKEditor starts on start , you have problems with characters encoding ?
And in your case it has nothing common with "Security settings" ?
Comment #24
goood CreditAttribution: goood commentedIn my case it has nothing common with Security settings on that page /admin/config/content/ckeditor/edit/Advanced
I tried this two scenarios (both with CKeditor disabled at start):
1.
a. click new content
b. write text (switch to ckeditor and back works fine)
c. switch to plain text
d. save
e. edit - text is ok
2.
a. click new content
b. write text (switch to ckeditor and back works fine)
c. switch to CKEditor
d. save - in view mode everything (encoding) seems ok
e. edit - text is wrong! - because CKeditor is started initially due to last article state before save
Comment #25
mkesicki CreditAttribution: mkesicki commentedI commited changes to GIT. Please test it and write if everything works as expected.
Comment #26
goood CreditAttribution: goood commentedFor me it works fine!
I tested it with both of Security settings and with enabled and disabled "Use Drupal text format filters ". Everything is ok.
Great work michal!
Thank you!
Comment #27
mkesicki CreditAttribution: mkesicki commentedComment #28
donSchoe CreditAttribution: donSchoe commentedthanks, it's working now. all i did was an update to 7.x-1.6.