Special Charecters = How are they saved and converted? Eg. Ö
Special Charecters = How are they saved and converted? Eg. Ö
raisonco
Posts: 17Questions: 5Answers: 0
If I save the name Özlem Yüce into my mySQL db via DataTables it is saved as Özlem Yüce
How is this being saved in the database? I'm using PHP and tried iconv to convert but without total luck.
eg. if I look through my database results (returning the above) and use iconv as follows:
iconv("UTF-8", "ISO-8859-1//IGNORE", $name);
This will convert to:
�zlem Yüce
Any ideas where I am going wrong or a better way to access these special chars saved to the db with DataTables? Thanks
This discussion has been closed.
Answers
Editor's libraries don't attempt to convert the character type at all. So it will be saved using whatever your PHP / MySQL connection it setup as and also what your MySQL Db is configured as.
Normally I would suggest adding
charset=utf8mb4
to thedsn
parameter for the config.php file - see this part of the docs.Allan
Have converted from utf8 to utf8mb4
(https://www.eversql.com/mysql-utf8-vs-utf8mb4-whats-the-difference-between-utf8-and-utf8mb4/)
Saved and same issue.
Shows ok in Datatables, but not in DB or in outputted...
eg. in DT
in DB
https://www.dropbox.com/s/dokq2ijt7xk5ahl/Screenshot%202019-03-15%2016.40.45.png?dl=0
Sorry, but any help appreciated - very stuck on this and feel I'm close... Thanks
Could you try adding:
prior to the Editor initialisation please?
Thanks,
Allan
I resolved this by adding to $sql_details:
I resolved this by adding to $sql_details array:
I resolved this by adding to $sql_details array: