0

I want to save HTML symbols in my database but they do get converted to random characters. I already have set every default character type to utf8_general_ci. When I do copy-paste the string in PHPmyAdmin into the table it is rendered as question marks.

what is happening copy "√∛∜(∑" into database colum gives output on website "???(?" send "√∛∜(∑∫π∠≤≥<>=≠≈≉≡≢⁰¹²³⁴⁵⁶⁷⁸⁹·⁺⁻⁼⁽⁾ⁿ" to databse is being saved as, and also being displayed on the website as:

"√∛∜(∑∫À∠≤≥<>=≠≈≉≡≢â°¹²³â´âµâ¶â·â¸â¹·âºâÂȉ¼â½â¾â¿"

Some additional information about the databse:

DEFAULT_CHARACTER_SET_NAME : utf8 DEFAULT_COLLATION_NAME : utf8_general_ci

Some additional information about the column:

Type : varchar(4096) Collation : utf8_general_ci

UPDATE:

By adding the following line to the submit file the symbols are put correctly into the database

$con -> set_charset('utf8mb4'); 
Mark
  • 103
  • 1
  • 9
  • Do you execute SQL command `SET NAMES utf8` on your webpage? – Lkopo Oct 04 '15 at 21:43
  • You can make it work, simply by changing your field collation to: **utf8_unicode_ci** you may also change the table's one to **utf8_unicode_ci** – Moïze Oct 04 '15 at 21:51
  • I do execute the command $con->set_charset('utf8'); I also dont think changing the charset from utf_general_ci to utf_unicode_ci will do the trick – Mark Oct 04 '15 at 22:03

0 Answers0