Open buttakbar opened 3 years ago
Will you please update me about it?
Make sure your characterset is utf8mb4 and your collation is utf8mb4_unicode_ci on your DB shcema
I had implemented the collation at the column level and It's working fine with the old version. is there any update that required these updated at DB level?
You need to either convert each table individually:
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8mb4
(this will convert the columns just as well), or export the database and import it back with utf8mb4.
I usually change it on the server side as a default.
I did all that but still the issue is there. I have updated the Database character set and collation, I have update it for the table and columns as well but still the issue is same, Please review the attached images
I did all that but still the issue is there.
Use utf8mb4 in charset conf $this->db = new MysqliDb (Array( 'host' => $JConfig->host, 'username' => $JConfig->user, 'password' => $JConfig->password, 'db' => $JConfig->db, 'prefix' => $JConfig->dbprefix, 'charset' => 'utf8mb4'));
I am also having this issue. I believe my table is correctly defined:
CREATE TABLE `trains` (
`trn_id` bigint unsigned NOT NULL AUTO_INCREMENT,
`emoji` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'emoji',
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
I believe my charset is correct as well. Since it follows the template of WRedMedia's post.
I can use the standard SQL insert methods without any issue on my table.
More info, the $db->getLastError() call reveals the following:
Incorrect string value: 'xF0x9Fx8DxBB' for column 'emoji' at row 1
I just double-triple-quadruple checked my work and found in this particular instance that my opening of a connection to the database was not specifying the charset correctly nor the collation. It is working properly now. Thank you for your hard work.
I was using older version 2.6 and everything was fine, But I have updated to 2.9.3 yesterday and I noticed that emojis did not save and retrieved properly with the updated class.