Specific characters in TinyMCE cause PDO exception

Hi all,

I have ActiveForm with yii2-tinymce-widget. It works but I’m facing an issue with some specific characters. So far, I have found that characters like č (c with caron) or ľ (l with caron) are causing PDOException:


SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xC4\x8D</p>' for column 'obsah' at row 1

However, some other characters with diacritic works okay.I have already tried to replace TinyMCE with Redactor and CKEditor but it failed with the same error.

Other fields (even field with my custom widget) accept these language-specific characters and write them to database without any trouble.

Please, do you have any ideas how to fix this ?

check your database encoding make sure you have utf-8 set for all the tables as well as the fields.

Database encoding is already utf8 but i have found that character set for column was latin1, although all columns in this table are set to utf8. Thank you Alrazi, your advice helped me find this mistake.