hi i need to store the weird character in my database but when i am trying to do so the weird character is replace with unknown character. i am giving you one example when i am try to enter in Sönke Wortmann in database it is stored as Sönke Wortmann. i want to store above text as same as it was.please tell me how can i do so
Share
You should use Unicode tables as well as a Unicode connection to your database.
Assuming you use MySQL:
Set the default character set of your table to utf8 and make sure the connection to your database is also using this character set:
See also: https://www.php.net/manual/en/function.mysql-set-charset.php
Check the character set of your current connection with:
See also: https://www.php.net/manual/en/function.mysql-client-encoding.php
When creating your tables do something like this:
If you have done these things and add weird characters to your table, you will see it is displayed correct.