Reading signs like č ć đ š ž from MySql database

橙三吉。 提交于 2019-11-29 12:27:19

Use SET CHARACTER SET 'utf8' before querying any data.

http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

  • Set table and db charset, collation, etc. to utf8_general_ci

  • After establishing connection from php, be sure to do SET NAMES UTF8. That step is very important.

  • Make sure you saved all PHP files using utf-8 encoding (that was common cause several years ago)

  • <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

I'm from Slovenia, where we use these 'special chars', and believe me, this is our everyday problem ;)

Try to do this before reading

SET character_set_client='utf8'
SET character_set_results='utf8'
SET collation_connection='utf8_general_ci'

You can add simply in your PHP (in Writting and Reading):

$con = mysqli_connect(...);
mysqli_set_charset($con,"utf8");

After having your table set as ut8 for default charset.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!